Hi, so I'm wanting to make a pretty big app but I'm not sure what database to use...
I know there's Mongodb, MySQL, PostgreSQL, and lots more. My question is: Which one should I use? What are the pros, and cons of each? Should I use a SQL or nonSQL database? Why would I use one over then other?
Could someone point me in the right direction?
BTW I do already know mognodb :)
Latest comments (52)
If you want a free and simple database for beginners, I recommend you start off with firebase.
I think a little strange sometimes so pay no attention to this comment. But seriously, I would use Docker. This way, you can use as many databases as you want in the same app. One section of your app could be for media files and the other for text. You may want to use Redis as well. Use an API and load balancer to tie the whole thing together as you desire. --------->>>> But check out MERN----> I feel it the future of app dev and of coarse you will be using Mongo.
This Database Architectures & Use Cases article may be really helpful in understanding which databases to use and why, including pros and cons of each type.
I think I figured out which kind of database I'm going to use for this project, but I'll have to remember to check out that article if I'm ever in this position again for another project. Thanks :)
No problem! Next time you'll have to check out HarperDB as well :)
👍
Definitely recommend the latest Autonomous JSON Database - you can get 2 for free forever with 20 GB of data (choose Always Free ATP).
Advantages:
More info: docs.cloud.oracle.com/en-us/iaas/C...
I've used Mongo in earnest for one app, and soon I regretted it. But I have to confess that for that app Mongo was simply a poor choice, I should have known better (it was more like "let's try out this fancy new thing").
PS: $lookup have huge performance drawbacks, Use ref instead.
Yes, I admit that $lookup is slow, in my experience.
I expect better with SQL joins.
I suggest Mongo since it is a general porpuse DB.
What exactly is a "general purpose DB" ? If Mongo is a "general purpose DB" then so are MySQL and PostgreSQL, you can use all three to store data.
Mongodb have a wide variety of tools, It's huge ecosysteme provide more general purpose products, If we talk about performance Mongo have the superiority from reading, creating updating.
MongoDB supports database that stores container data structure, i.e. not normalized. Not only storing, but indexing as well (arrays, deep json's).
What it lacks. from what I can see, are foreign keys and triggers; as well as user-defined functions. (Maybe because it doesn't have complex SQL variant.)
BTW, I don't really understand why database choice matters, unless you aim for specific features.
Yes, you can put normalized data in MongoDB, and denormalized in Postgres.
But MongoDB supports deep JSON indexing and Array indexing, as well as compound indexes. Not sure about any traditional RDBMS.
MySQL does support JSON lookups and indexes. Never used it, but I've heard that it's there.
I think devs underestimate the power of Mongo, If you aren't planning to make a db model that rely on huge amount of joins then Mongo is the best choice.
Whether Mongo is the best choice or not totally depends on your use case - what does your app do ... without knowing the use case it's impossible to say if Mongo is the best choice. In my experience, in most cases it isn't, but for a certain class of cases it might be. So the answer is "it depends". But well, "huge amount of joins" - even when your data model has just a dozen joins/relations then an RDBMS may already have the edge, from an ease of use point of view.
I like starting with sqlite. Easy and fast until you need more - then postgres db is good.
SQLite is in a different league from online database, where there need a lot of admin jobs and housekeeping.
Well, as a general direction, you have SQL, noSql and blends.
SQL: you have mySql (though Mariadb as a drop-in MySQL replacement is significantly better and provides noSql models as well as climb stores) and postgresql as main options. I generally go with Mariadb because I know it better and how to optimize it. Don't disregard online sources.
NoSql: for all intents and purposes Mongo is ahead.
Column store: I strongly recommend Clickhouse as a high performance column store with SQL compatible syntax.