2
6 Comments

Hosting your database?

I am working on my first SaaS app and I am confused about database hosting. I have a few options in mind, first is self hosting my database on a VM or a container, other is to use a managed service which might cost more. I am worried about backups and data loss. I am pretty well versed with linux and I think I can manage my own server. Currently I'm thinking of setting up a cron job that periodically backups to S3. Is this a viable approach? What are the things I should consider and any other general tips would be really helpful.

Thanks a lot!

  1. 2

    I would use https://supabase.io/

    It is also basically a backend server. You would rely less on say Node/Python and just use their client side JS library.

    For custom queries you can use SQL. If backend code is needed you can build simple JS scripts.

  2. 1

    If you are worried about data loss or that you may have problems managing the database yourself, then I would definitely use a managed service.

  3. 1

    As @kylegawley says, you're probbaly better off paying someone to manage that for you. Providers like AWS, OVH, MongoDB Atlas, DigitalOcean have managed solutions at different price points. I'd probably use what suits you best, and make sure there's offsite backups.

    When the DB is what holds your customer data, billing data, etc... it's pretty crucial you don't get that wrong.

  4. 1

    In general I host my sites in the cloud (OVH mainly). I was impacted during the Strasbourg fire however I now have a reliable backup system in place that allows me to go back online within an hour or so (Files copied every hour + DB dumps). It's also possible to replicate a DB with a master/slave configuration so that you write to the master and the slave copies everything, all the time

  5. 1

    I wouldn't advise doing it yourself for two reasons:

    1. If this isn't your area of expertise, then don't go near it.
    2. Your time is better spent doing other things, not managing a database server

    Digital Ocean have great SQL cluster for $15/mo.

  6. 1

    I am worried about backups and data loss

    With any kind of production database, this is usually the biggest and most valid concern, and unless you've got the experience doing it correctly, trying to do it yourself could very well result in you nuking everything on accident. Or worse, thinking you have backups and something going horribly wrong where you cant recover from your backup.

    Rather than manage it yourself, I'd definitely suggest going with a cloud-hosted option. AWS offers a really generous free tier for RDS (like 15GB of disk space, 1GB of memory I think) and you can scale that up at the click of a button if you need to. RDS will take care of managing your backups for you as well. Other cloud providers have options as well, RDS just happens to be what Im familiar with and use regularly.

Trending on Indie Hackers
I launched 12 companies from $0 to $2MM ARR. Let me answer your launch questions. AMA! 53 comments Why is Building in Public a good thing to do? 16 comments My website translation app just hit $18k MRR 🤑 9 comments [12 months free] for honest FEEDBACK on my product! ~ PhotoATM 6 comments I've asked 750+ startup founders. "How did you come up with your idea?" Here are their answers 4 comments 9 Ways to Validate Your Startup Idea 2 comments