Score:0

Implementing a mono-repo, multi-database PHP application on AWS

eh flag

I have a application whose code is hosted on GitHub. This application is a school management system built using the Laravel Framework. I need advise on how I can implement it with the following architecture.

  1. Each school has its own database. (Multi-tenancy-multi-database)
  2. All schools share the same codebase
  3. Each school has it's own custom subdomain.

Currently I am using Heroku. What happens in Heroku is;

  1. I simply create an app,
  2. Update the ENV Variables (DB_Name)
  3. Get the DNS Nameserver address and create a CNAME record on CloudFlare to create the custom subdomain for the school.

I now have to replicate the same workflow in a different server provider (AWS or On-Premise Server)

If I was to choose AWS, how can I implement the above workflow? And I were to go for ON Premise how can I implement it?

I just need the advise around which tools to use, the rest I think I can figure out. I am still new in DevOps, my technical knowledge is still very foundational.

I would really appreciate a guide on how I can best go about it.

Tim avatar
gp flag
Tim
One database or one server per school? Either model is unusual outside of very high security systems, but it's useful if your code is buggy and can't be trusted to enforce security.
Ation avatar
eh flag
One container per school.Data Isolation is a key requirment in this case
Tim avatar
gp flag
Tim
Ah. You're basically just deploying many instances of your application. You would deploy it the same way as the existing host, the services just have different names. I would probably deploy the application in ECS using Fargate containers, database into RDS with many databases on one database server (though you can use one server per customer if you like), Route53 DNS. AWS is reliable, but can be expensive, particularly for bandwidth. You could consider AWS Lightsail VPS VMs, but then you have to use docker and manage everything yourself. Digital Ocean or similar would be cheaper.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.