Which database should I use for a killer web application: MongoDB, PostgreSQL, or MySQL?
-
I'm working on killer web application, and I am really interested and worked with MongoDB. Is it a choice to choose MongoDB as a premier database? Or Is it better to use MySQL (with MongoDB/Redis as secondary)?
-
Answer:
So the question should have been more like 'When is MongoDB a better data retrieval solution than mysql?' I'm going to try to do justice to the comments, adding a little flavor here or there. Sui generis Of course its difficult to say without benchmarking your app both ways. That's not entirely helpful as the number of data stores is swelling and you don't want to prototype and load test all of them. To me, the Mysql vs MongoDB benchmarks are revealing as they show that with beefy hardware, a NoSQL engine does not have to be faster than a well indexed Mysql Table, which might seem the case. Its likely that in less optimal hardware the mongodb's performance drops off more slowly than mysql - the sql front end must have some overhead. So, what can be said? the Answers left me with three take home issues for data store choice: What Data Structure do I really want? MongoDB's object oriented data storage makes it much more flexible when the documents stored are not uniform - often the case in web apps. MongoDBs various APIs can take in JSON directly. If you have designed your sql schema for fast data retrieval, you are avoiding large numbers of documents (high millions) or are partitioning the tables and avoiding joins to tables with any large size. NoSQL data structures encourage you to do this naturally, having no real provisions for joins. How much is this going to cost? If your app is already built over an SQL operation or that is where your engineering expertise is much stronger in SQL it sounds like engineering can deliver strong scaling performance can be had from mysql or oracle. As far as scaling MongoDB there is a lot of engineering you don't have to do to scale. It shards and scales effectively using built in features without the extensive setup required for clustering RDBMS systems. There is no free lunch There's no magic in NoSQL;- The indexes should always be smaller than your RAM - this is true for NoSQL and SQL. I think scaling some applications with large numbers of commits might be difficult with SQL apps unless you have careful partitioning designed in. On the other if you have good throughput reads while doing commits, not all the users will see the updated data at the same time. A lot of well known scaling issues are built into the newer data stores, but experience and careful design are still important to get anything to performance scale well.
Answer Wiki at Quora Visit the source
Other answers
Whether a benchmark is relevant to you always depends on the use case. Very few systems are ever categorically better than others, but many are situationally better (but your situation may change).
Anon User
Determine the purpose of your persistent data store needs including the type of data, capacity and latency requirements, then choose the product or products that best suit your needs. There is no one product that fits all your storage needs. Maximize the strengths and minimize the weakness of the chosen product. MySQL is great in some circumstances, a key-value store or a NoSQL production is great for others.
Ronald Bradford
If you have a deadline to meet, I think it would be best to start out building your prototype with what you are most familiar with (as Kevin Nuckolls suggested). One mistake that people almost universally make when starting out to build their version of a killer application is that they start thinking about optimizing their project before even having a working prototype. It's quite easy to get lost in ideas and entangle your code by limiting their ability through the premature optimization lens. Moreover, remember that your database engine is just a component of your overall application architecture. No matter how good you scale your data and optimize it to fit your query patterns, it is just a small part of the overall experience that your application is delivering to your end-users. As I usually work with JavaScript full-stack, I prefer MongoDB for building a prototype real fast, as it integrates seamlessly with JavaScript. Even if you use a different backend technology, MongoDB has some really well designed and packaged drivers for any major programming language. In the end, if you can't actually find a good application similar to yours that has a battle-tested stack, I recommend you invest a bit of time in benchmarking the available solutions to identify the one that delivers the most value in terms of performance for your application. You'd be surprised to see that, even if you come across a good application infrastracture with a certain DBMS engine implementation, there might be some other variations in your code base or algorithms that might benefit more from a different DBMS.
Vlad Zamfirescu
Is your data a loose collection of relatively incoherent data such as various files,blogs, or comments on blogs, etc.? How would you do a search? Or is it easily quantifiable data that you can store in tablestructures (and maybe parts of it in blobs) mySQL? Answer that question to have your answer.
Finnbogi Ragnar Ragnarsson
The question is missing details as to what you are trying to accomplish and so why are you asking. If you are trying to fix write performance in your current system, then changing databases won't help you in 99% of cases because typically this is caused by having an un-optimized schema and/or queries. If you are starting a new project that will be write-heavy, then either product will serve your needs just fine, but each with its own set of strengths and weaknesses. For more comparison, check out: http://www.wikivs.com/wiki/MySQL_vs_MongoDB
Eric David Benari
It really depends on what you're trying to build. For example. I've been working on a blog based on MongoDB. In a lot of ways, it would be easier to build with a relational database like MySQL or PostgreSQL. However, for me it's more of an exercise. I have seen that if most of your information can reside under its parent objects, then MongoDB structurally would probably work very nicely. It's also pretty lightweight and I've heard that it shards/scales nicely. Can you give us a general idea of what you're trying to build?
Charles Max Wood
Use PostgreSQL. Avoid all the stupid things Mysql does badly to try to be helpful, and gain a whole raft of similar capabilities to the NoSQL datastores. You won't look back.
Brad Murray
You would find good answers for this through google. I found this particularly interesting when I searched for the same question. https://www.udemy.com/blog/mongodb-vs-mysql/
Shravan Varma
There is no standard for working with MongoDB. MySQL and most other RDBMS tend to conform to the SQL standard for their core programming API. It is also cheaper to find people who can do SQL for the day to day stuff than find people who have MongoDB or to train up on MongoDB. http://www.trajano.net/2014/02/why-i-dont-recommend-opensource-for-the-enterprise/ That being said, MongoDB does it's job well and it's faster for certain operations that do not require ACID semantics. In fact, for a specific use case namely being able to manage unstructured data and having efficient ways of going through it, MongoDB is one of the best tools around.
Archimedes Trajano
Related Q & A:
- Which preposition should I use?Best solution by German Language
- How to create a Restful web service in .Net Using MySQL?Best solution by stackoverflow.com
- What framework must I use to develop mobile native application?Best solution by Stack Overflow
- Which GPA do I put on a college application?Best solution by talk.collegeconfidential.com
- How much should I charge as a freelance web developer?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.