Why I am dropping MongoDB for Mysql...
blue74.com
blue74.com
- There are no transactions in databases like MongoDB. That's clear.
- Reported "corruption" and data loss but no reproduce steps. What version? Did the server crash? Have you reported to the developers? We've been using MongoDB for over a year in production having started at v0.9 and now using only stable releases and have never lost any data when we do 5-8k inserts per second.
- No joins. It's a non relational database, what were you expecting?
- Schemaless. Yes - don't make typos / QA your code.
- Unstable replication. We've had a few issues with replication but nothing that can be described as "unstable". Again, a general statement "nothing but problems" without going into specifics.
- Not stable. I refer above with our long usage history. It's unstable if you use the dev versions, as expected.
I don't claim MongoDB is perfect, indeed I've written about several issues we've had[1], but nothing critical or show stopping. It seems it just isn't a right fit for what the author wants.
[1] http://blog.boxedice.com/2010/02/28/notes-from-a-production-...
- Lack of Transactions
- No joins
- Schema-less
If these are important, you really shouldn't have been using schema-less document database.
- Unstable
This is the only real point I can give to you unless you were actually running the bleed edge version. If you were using the trunk/head version you were just asking for the problems you were having.
What does that have to do with his complaints?
The "lack of transactions" is a lack of MVCC. This has nothing to do with NoSQL, RDBMSs, document databases, or schemas. Many NoSQL databases do offer some transactions support ... like CouchDB or the storage in Google's AppEngine.
"No joins" ... we've been taught for years the virtues of normalization / relational data, both in school and throughout the industry, and now we should let go of everything we've been taught. Great, but where are the best practices / patterns? Where are the books on data-modelling?
"Schema-less" ... it's not really schema-less, it's just that the schema is defined at the application layer. Again, where are the best practices for that?
One advantage of MongoDB in combination with something like Rails is said to be the lack of migrations ... I view that as a disadvantage as migrations are a great way of documenting what's changed.
To get back to my point ... don't shout at potential users something akin to RTFM ... educate them instead.
The majority of his enumerated gripes aren't unexpected or hidden attributes of mongodb but fundamental considerations when deciding on a data store.
Of course he may have needed to do this project to discover that.
The author's project requirements list transaction support. Meanwhile, MongoDB explicitly mentions it is not suited for transactional systems.
I agree, he needed an SQL db from the beginning.
E.g. - transactions, isolation, referential integrity and other feature were too long coming. They did provide a free portable DB that ran on Windows early on and parsed SELECT statements, though :-)
They had that years ago using InnoDB. I remember using it in 2003.
MySQL's big thing over Postgres was replication.
My main problem with mysql is that I have seen too many data corruptions and I can't find anyone who has worked with both systems and doesn't recommend in general pg over mysql.
Here are the docs: http://developer.postgresql.org/pgdocs/postgres/hot-standby....
Oh, and unlike the MySQL replication this implementation can not silently lose or corrupt data.
In fact the above document could also be considered "The missing Manual for MySQL replication". It tells you all the things that MySQL doesn't take care of.
I don't think I'm an uber admin. I just try to use so few services as possible and update my shit. Hopefully this is enough.
Maybe he skipped that part?
"Of course, some problems require greater durability: we would not recommend using it for a bond trading system."
But I'm not 100% sure. Can anyone more familiar with Mongo internals confirm?
That said, the article seems to imply "missing documents" with no crash. That is something I've never seen reported before this post.
I'm actually in the opposite boat that the author is; I'm trying to find a good excuse to start using Mongo. I need to get better at modeling data without schemas... I don't feel comfortable using it until I get better at the design aspect.
I think there are also some videos linked from there that should help.
Bookmarked. I can't wait to dig into this. Thanks again.
[1]http://www.mongodb.org/display/DOCS/Durability+and+Repair
Which version was he using? I've never had data loss in a year of production using the "stable/production" version of MongoDB.
proposed solution: use SQL or (SQL and NoSQL)