Total Pageviews

Thursday 19 December 2013

各种数据库的比较



What I like:
  • Nice api
  • No schema
  • No Auto Increment Id’s built in
  • Decently simple to work with
Why Mongo?
It was is really important to me to keep the database layer as simple as possible and be able to migrate the data out easily, If I could use grep and a set of files, I would.

I ran a lot of simple benchmarks to see what I would need. I boiled it down to using MongoDB, Riak, or MySQL. I really like Riak, I plan on getting more experience with it and migrating to it from MongoDB.
MongoDB get’s a log of hate but having control over fire and forget inserts and safe inserts is pretty cool I think, default unicode is awesome too. However journaled or fsynced inserts are painfully slow, which is a problem since MongoDB has Master nodes. If I didn’t have to worry about writes at all MongoDB is great since reads are really fast.

I think MongoDB would be great for something like a Blog if you used Fsync inserts(slow? who cares). So here’s some notes from the databases I looked at:
What does worry me.
  • Master Node
  • I like as little critical services as possible, I don’t want to have Arbitor services and Sharding Manager services.

Riak
  • Masterless! but eventual consistency.
  • Awesome but I needed more experience with it.
  • Not as mature as something like MySQL
  • Node goes down? no big deal.
Redis
  • Dataset has to fit in memory
  • Querying redis isn’t easier or I probably would have used it
  • Damn, Redis is so awesome..I wish..
MySQL
  • I am not great with the ins and outs of SQL
  • Since I didn’t have to use SQL I wanted to use something else more for a mindset of thinking outside of SQL
  • Schema (not that this is a bad thing)
  • SQL Querying can be painful, but peeweee solves this.