I'd love to see http://eagain.net/articles/git-for-computer-scientists/, but for every DB technology.
I'd love to see http://eagain.net/articles/git-for-computer-scientists/, but for every DB technology.
The best database engine I've encountered in this respect is SQLite. It has plenty of information about what design tradeoffs it makes, and why, e.g.:
http://sqlite.org/lockingv3.html
I'd like to know more about how this part of the article came to be:
"This choice was made early on and it was supposed to be a temporary one."
HOW was that choice made. What requirements were out there. I think too many people choose Mongo because they believe it's "schemaless"[1] and faster for development, but don't look at the requirements for their actual use case.
[1] - There's always a schema. Either it's informally defined by your code or represented formally somewhere else.
I think the hard thing for us up front was that trying to explain Cassandra data models to someone (and this guy is really really good) and then hand the rest of the work over to them to implement now, on a contracting rate is not a trivial problem. And we needed to hurry for both deadlines and burn rate.
I've yet to use it for any load, and am struggling to triangulate from all the articles I read on whether it does/doesn't scale efficiently.
All the issues I have hit so far have been self-inflicted, it is still one of the best new technologies I've used in years - but is has taken a while to stop thinking in SQL equivalents and start thinking natively.
It doesn't. Three words: "global write lock". Writes block reads, reads block writes. Implications: if you run a query in production that doesn't hit an index, all traffic stops. The notablescan setting is a very, very good idea. This also means all queries must have an index, so Mongo ends up with more indexes than say, postgres would.
It's impossible to configure a clustered mongo environment to not lose data: http://aphyr.com/posts/284-call-me-maybe-mongodb
Sharding configuration is baroque, and limited.
https://blog.serverdensity.com/goodbye-global-lock-mongodb-2...
Now locking is on the database level.
Couldn't you just work around that before by running a separate Mongo process per database?
Saying it's now on the database still means any single-database app is globally locked. Or does using Mongo imply you're going to be making lots of databases so this actually means anything?
It's perverse.
Even if Mongo did have a global write lock, which it doesn't as has already been covered, it yields on page faults which means that other queries are minimally impacted. See: http://docs.mongodb.org/manual/faq/concurrency/#does-a-read-...
As to your linked doc, emphasis added:
> In some situations, read and write operations can yield their locks.
> Long running read and write operations, such as queries, updates, and deletes, yield under many conditions.
In practice, I've been bitten hard by this. A new feature rolls out, and users can't log in anymore, because a query is taking 2 minutes to run.
http://www.xaprb.com/blog/2013/04/29/what-tokudb-might-mean-...
A daunting task with hundreds of shards!
But replication from MongoDB to TokuDB does not work.
The second I can migrate to another data store, I will. Unfortunately that kind of refactor isn't possible right now, but all new projects are using different tools.
this is a fantastic idea. if someone gets this going I'll enthusiastically contribute.
It would be useful to treat databases as those big data structures, knowing the best/average/worst case, cpu vs. memory trade-offs for search, etc.