8
18 Comments

Hey React devs, what database do you use?

I'm working on a React codebase generator (divjoy.com) and launching database support next week with Cloud Firestore. I'm considering also adding a Mongo DB w/ REST API option. There are a ton of other databases out there... Hasura, Fauna, Postgres, etc. What's your favorite and why?

on March 7, 2020
  1. 4

    Should I hide under my desk if I say MySQL + Rails? 🙈 BTW love your two projects, especially useHooks was a place I frequently consulted when learning hooks 🏆 I've always been lazy to give divjoy a try, but seeing database support will be coming, I'll definitely take a look (and finally try NoSQL!)

    1. 2

      MySQL + Rails seems totally reasonable! I don’t have a strong sense of MySQL vs Postgres. Any reason you went with MySQL? And that’s awesome to hear you found useHooks so useful. If you want to give Divjoy a spin in the future here’s a discount: divjoy.com?promo=indiehackers :)

      1. 2

        Thanks! Well the backend was started off as a LAMP stack and while migrating to the "new" Rails backend (that was more than 5 years ago) it was decided to stick with MySQL which was the popular choice back then.

        We also use Redshift which is based off Postgres for all our big data. Both seem to be good and survived the test of time.

  2. 3

    I absolutely love MySQL. I've tried Postgres and it just is not as satisfying. I find MySQL to be incredibly easy and intuitive and very rarely throw crazy errors. Everything is well documented and if you're ever concerned about licensing, you have MariaDB as a completely seamless transition.
    MySQL workbench is a very very good database management GUI and you can run it on any operating system including Linux (not just MySQL server, but MySQL workbench.
    And where MySQL workbench falls short, HeidiSQL picks up the slack.
    As of recently, JSON objects have been added as a value type so you can get the benefits of a document database and a relational database.

    I saw a video on YouTube about about "why you shouldn't use MySQL" and it made me lean more towards Postgres at the beginning, but coming back to it with some real experience - I realized that the person leading the lecture in that video was really nitpicking heavily and going out of his way to cause errors. The type of errors that you just don't come across in real world scenarios.

    I've been working with MySQL for many years, and I've never paid a penny for it, but my entire business which had roughly $700,000 a year in revenue was built entirely on top of a MySQL database.

    And to further get my point across - I'm not a PHP developer and I don't use the LAMP stack. I'm a node.js and c# .NET developer.

    The native MySQL integration for NodeJS is very easy, one page of documentation for the most part. When I am building something in C#, I use Dapper (a very simple NuGET package built by StackOverflow).

    I've never used PHPmyAdmin but I know that people love it.

    I also really like MongoDB because BSON is very similar to JSON which is already incredibly intuitive.

    But I would pick MySQL over MongoDB 9 out of 10 times.

    1. 2

      Nice, what's your preference for React framework (CRA, Next.js, etc) and authentication (handled yourself and stored in fauna, Auth0, etc)?

      1. 2

        It depends. Usually, I like to start my MVPs using CRA and Next Functions. For Authentication Fauna has a nice auth and ABAC system to provide secure access. GraphQL is also pretty cool to start things faster.

  3. 2

    I used nothing but DynamoDB and Firestore for the past 2 years professionally, but i think this will be overkill for 90% of side projects people are starting.

    Your suggestion of MongoDB + REST API is IMHO the best solution for building MVPs (which will probably be a considerable amount of your users) because there's little to no overhead configuration when you're just starting out.

    1. 1

      Thank, I appreciate the input!

  4. 2

    Mongodb and PostgreSQL

  5. 2

    Postgres + Rails

  6. 2

    PostgreSQL

  7. 2

    MySQL(Maria)/Postgres for remote and Dexie(IndexedDB) wrapper for client side offline use(PWA).

    So far MySQL with node-mysql2 has been easiest.

  8. 2

    My fav is mongo because the node lib is made by themselves and it’s pretty performant, otherwise mongoose provides flexibility of schemas although new versions of mongo allow that as well. Here’s a simple repo where I set up the use of mongo with next.js but could easily be replicated on an express server.

    https://github.com/mgranados/simple-login

    1. 1

      Thanks! That example is going to be super helpful when implementing Mongo with Next.

  9. 2

    I use Mongodb and Mongoke (https://github.com/remorses/mongoke)

    Mongoke is essentially Hasura but for mongodb, to use it you just need a docker-compose file and a configuration that defines the database schema.

  10. 1

    My in-app DB is RealmDB and I use Mongo on the server

  11. 1

    This comment was deleted 2 years ago

  12. 2

    This comment was deleted 7 years ago