Hi guys,
Im looking for some guidance.
Im a novice developer and have a project that allows schools to set homework for their students. The project is written in Yii 1.1. Im looking to convert the project to a Laravel project. I suspect I will have a lot of learning to do before I can begin.
In converting the project I am also looking to add some new features. In particular, the ability for my schools to take attendance. However, I have some issues and need general guidance.
My database is Mysql and my dedicated hosting limits each database size to 2gb even though I can have unlimited databases.
If i set up a attendance module and given that currently I have 10 schools, totalling 2000 students approximately, how quickly will my database size limit be reached?
How should I design the attendance table? Im thinking as a simple example, id, school_id, student_id, attendance_code, date etc.
If I stick to above design, Im thinking I will have a huge number of rows very quickly, and given that I have to keep the records for at least 5 years, this table will become huge. Is it therefore, better to have separate attendance tables for each school?
If so, ie have separate tables, how will I manage this dynamically when schools register to use my service? Is there a possibility in Laravel to use dynamic table/model names?
Will it be better to have a separate database just for attendance and link by school_id? Can this be done in Laravel?
Or is it better to opt for a different database with larger size limit?
Apologies for the long post. Just looking for guidance.
Thanks.
2Gb might be a bit small but depending on how you build the database model it probably will last for some time. It's not the first thing I would worry about since you can scale it up when needed.
The attendance table will have a lot of rows but that shouldn't be an issue since you are using foriegn keys instead of storing the value
Sound good to me but it might be wise to use a foriegn key for the attendance code as well.
No one table is the way to go here. With the proper indexes it should be fine.
Yes it's possible but it will give you more trouble than it's worth.
I would say no since multi tenancy it's quite easy to handle in a single database. Using multiple databses is usually more trouble than it's worth.
Probably a larger db migth be advisable yes. You can always test and see how much space 2000 students will generate over seven years. Like I said in the begining you can always scale later.
@alombia I think working with such constraints is going to be a bit of a distraction from learning a framework like Laravel.
Not only will you be learning a tool (Laravel), but you’re also going to be having to learn that tool and also come up with workarounds to these limits that really aren’t an issue anywhere else. So you could potentially be inadvertently instilling bad practices in yourself.