I'm planning to host a web application that consists of a Front-end, Back-end (Written in NestJS + TypeORM). This Web application requires a database like many others.
Something I'm struggling with right now is figuring out what's a good way to host my database. My web application has relatively low usage (think 1-3 users during office hours) so there's no real need for some crazy load balancing between N number of EC2 instances.
What I'm thinking of is hosting a singular EC2 instance (probably t4g.nano 2vCPU and 0.5gb ram @ 27.16USD/month) as the backend, but what I'm stumped with is what to use to host my database.
The options I came up with are:
- Configure TypeORM to sqlite, then store the sqlite file on an EBS volume which is backed up by EBS snapshots for redundancy. This is roughly 2.88USD/month with 30gb storage.
- Use a MySQL RDS instance (t4g.micro, 2vCPU and 1GB memory) reserved for a year for a whopping $162USD upfront and $30.42USD/month.
Now RDS seems like it's way to expensive and overkill, but I'm just worried that EBS + SQLite might not work. But (in my very limited experience) it should especially when there's only atmost 1 process reading/writing to it?
So my question is:
- Would the EBS + SQLite solution work? In the event EC2 goes down would re-attaching the newly-spun up EC2 instance to the SQLite database found on the EBS volume be problematic or could it be solved with a bash script?