DB deployment help

I need some advice on deployment. Right now, I have an app that I want to deploy using docker to containerise it with mysql, but I found out yesterday that it’s very flaky and nearly crashed the VM I have it hosted on for my staging server (smallest linode instance) How would you recommend hosting a DB for a shop? Keep it as SQL and use SQLite? Use planetscale? Or go NoSQL/serverless?
12 Replies
alexetai
alexetai2y ago
Heavily depends on your use case, would you have a lot of random read and writes ? Would you expect to ever use the scalability features ? If the answer is no, AWS RDS is a great solution. Planetscale and all of the other serverless options only make sense if your users are truly global, and you need the scalability features.
Anthony
Anthony2y ago
Yeah that makes sense. This is a low read/write database as it’s just a small scale web app for only 1 state here in Australia. Would it be better to use RDS over self hosting the database on a VM?
alexetai
alexetai2y ago
Absolutely, hosting your own database is a lot of effort, you have to think about updates, maintenance etc, and you lose out on all of the monitoring/analytics offered by a managed service What kind of data would you use the database for ? Just product pictures prices etc ?
Anthony
Anthony2y ago
Products, users and orders I’m also using it for sessions, but may transition it over to redis if it results in a lot of read/writes in the DB
alexetai
alexetai2y ago
Are you doing authentication yourself ?
Anthony
Anthony2y ago
Haven’t got authentication in yet (will be a feature after launch) but most likely will be doing it myself
alexetai
alexetai2y ago
AWS RDS, i believe you would fit in the free tier (https://aws.amazon.com/rds/pricing/)
Amazon Web Services, Inc.
Managed Relational Database - Amazon RDS Pricing - Amazon Web Services
Amazon RDS is free to try with no minimum or upfront fees, and only pay only for what you use with On-Demand or Reserved Instances.
alexetai
alexetai2y ago
I would not do auth yourself, there are a lot of very good authentication providers. If this is a production environment and you are using next i would look at https://clerk.com If you are not using next, auth0 is great.
Clerk
Clerk | Authentication and User Management
The easiest way to add authentication and user management to your application. Purpose-built for React, Next.js, Remix, and “The Modern Web”.
Anthony
Anthony2y ago
I’m using Remix. Haven’t deployed to production yet, so I kinda have time to change things around
alexetai
alexetai2y ago
Remix Authentication | Clerk
Easily add secure, edge- and SSR-friendly authentication to Remix with Clerk.
Anthony
Anthony2y ago
Awesome, this looks really good! Thanks so much for your help
alexetai
alexetai2y ago
No problem at all, have fun!
Want results from more Discord servers?
Add your server