I am interesting in learning when to use a SQL database, such as MariaDB, and when to use a NoSQL one, such as MongoDB. Is there a specific case where one is preferred over the other?
-
2Good question but probably the wrong site to ask. – Sep 27 '15 at 02:02
-
Learning often involves following advice, reading and applying what you have read. Please read help→tour and apply the part about no chit-chat to future posts. It also helps to read about what questions should be asked here on the help pages. – Anthon Sep 27 '15 at 08:07
-
Flag as off-topic. Please move it to http://dba.stackexchange.com/ – Vlastimil Burián Sep 27 '15 at 08:28
-
@burian.vlastimil How do I move this question to dba.stackexchange.com? Should I go ahead and ask the question there, or is there a way to actually move this discussion there? – gacanepa Sep 30 '15 at 12:48
-
@Anthon, Not really sure about why you think the chit-chat part in the help->tour document applies here. I asked a straightforward question and was hoping to get answers just like the one below. – gacanepa Sep 30 '15 at 12:51
-
@gacanepa I already edited the offending parts out. Look at the edit history. Thanks and pre announcements of what is welcome are the chit-chat that you should leave out of good posts. And that you get answer here that is to your liking doesn't mean your question is appropriate for this site. – Anthon Sep 30 '15 at 15:46
1 Answers
The main point I had to look at when I had to decide to switch from an SQL to a NoSQL Database was the scale of my project and my own conception.
SQL database main advantage is the ACID compliance, that make sure you while always get good answer in the shortest possible time. It's a simple and an "old" technology that proved to be reliable in good hand. Thing is that it wasn't probably designed to fit the new trend of big data, and SQL base can become little nightmare to maintain when you will try to distribute it for load management.
NoSQL database, like MongoDB or Cassandra are build to answer the specific case of your data becoming to huge for your model. They simply start with the idea that you have distributed your database, and are in a situation where you can not have a good old acid compliance anymore. They decide then to take advantage of that for their features. As an example, I think that Cassandra was build by Facebook to support message between users on their site. It's basically build to be a worldwide distributed database were you could lose a complete data-center without losing data nor have your site down for a second. Such an infrastructure would be almost pretty hard to maintain with other SGDB that rely on your information to be perfectly up to date everywhere in your system.
In the end, you should also see that NoSQL database were mainly designed to fit the need of Google and facebook.
Unless you project ever have to match the need of handling millions of simultaneous users as facebook did when they started their NoSQL base, a good old MariaDB or postgreSQL based on ACID compliance is faster, more accurate and easier to build and grown.
I could also encourage you to take a look at the NewSQL movement which are composed by developers that re-implementing SQL engine to correct some pretty old design choice. I have took a quick look at it but I can't remember any website using that king of technology. Also keep in mind that you also may encounter the need for an hybrid solution by using a SQL and a NoSQL base (A friend of mine build a postgre/Mongo stack that worked pretty fine), that may be more complex but can also be more powerfull.

- 32