Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
xalys16077yIt depends. We'd need specifics to say. One is not by definition better than the other.
-
Voxera113887yWe tried MongoDB and my recommendation is, if you do not know what your needs are for a database, go with an sql.
Mongodb and other nosql databases are very good at some things but can be utterly impossible for other.
And if you later find that you need the nosql, use both.
At least until you know the nosql db good enough to know its the right choice.
A relational is more flexible but it might not scale as good as a nosql.
The real exception is social network problem, if you have that kind of problem use an sql + a graph db. -
mindev5367yYou could always use PostgreSQL. You have relations, but if you ever need to store json, you can do that
-
Voxera113887y@DawidCyron The differences is how you can manipulate it.
Mongodb can make changes directly into a stored object like adding an item to a list in the object without touching the rest.
You could fir example add one item to a list in all objects witch has less than 4 in price and where the new item does not already exist.
I do not know if postgres can do such manipulations, and what performance you get.
BUT thats the scaling problem :), postgres CAN solve the problem for you and if you find you need the speed later you can always switch then.
But MongoDb cannot really do relations, especially not with transactions.
There are not join solution.
So if a child need to be part if multiple parents in sql you just link to it with joins.
In mongodb you have to store lists of ids and make multiple queries, which might get out of sync so your result is not consistent.
You might find ways to solve this but it gets very complex fast.
Almost any such situation would be better served by going multiple db.
Sql as base, mongodb for object storage that do not need relations, a graph db to handle network relations, redis or similar for caching and messaging ...
That way you can get the best from each type.
But sql is still one of the most flexible, even if not the fastest.
And with json storage you avoid the problem of multiple joins to get an objects data. -
Your language choice is irrelevant. What matters is what you are trying to accomplish.
Related Rants
When it comes to choosing a database, What is the best for a Java project?
1.SQL - MySQL
2.NoSQL- MongoDB
question
sql
nosql
mongodb
mysql