Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nosql - getting over the bad parts

Nosql - getting over the bad parts

Talk held at Scandinavian Developer Conference in Gothenburg

David Dahl

March 04, 2013

Transcript

28 slides
  1. Overview ‣ Real life lessons ‣ Production systems ‣ Write

    heavy ‣ MongoDB ‣ Redis ‣ Cassandra
  2. generic ‣ Took a DB class? - Forget everything you

    learned! ‣ Denormalize all the things - Up to a limit ‣ Consistency is your responsibility ‣ Primary keys - Give them a lot of thought
  3. { "_id" : ObjectId("51235a80472689978000004e"), "access" : { "admin": ['some_app'], "deep_access":

    { "another_level": 1 } }, "apps" : [ 'some_app', 'some_other_app' ], "created_at" : ISODate("2012-07-23T13:31:17Z"), "email" : "[email protected]", "state" : "active" }
  4. Good stuff ‣ Replication - It just works, and it

    works REALLY well - rs.init(), rs.add(“second.node”) ‣ Schemaless + secondary indexes - Add whatever, query however ‣ Javascript CLI - db.find({name: “Clive”, birthdate: {$gte: ISODate(“1975-05-01”)}})
  5. Single threaded a.k.a That 30s list command i just ran

    blocked the entire production system (that totally never happened)
  6. Persistance ‣ RDB - point in time snapshot - Entire

    process forks. - Enable overcommit memory! ‣ AOF - write log - Very slow on startup ‣ AOF has higher priority on startup - Enable at runtime or loose stuff ‣ Monitor your log files!
  7. No clustering ‣ Only master-slave replication - No failover ‣

    Redis sentinel - promising but not ready ‣ Redis cluster - unstable/”not production ready” ‣ Twemproxy
  8. Good stuff ‣ Wicked fast - To a limit ‣

    Deletion - not a problem ‣ TTL - on key level
  9. Extremely java centric Some of you might think thats a

    good thing... 1.2 and CQL3 makes things a lot better
  10. Good stuff ‣ Black magic - Complex, but well made

    ‣ TTL on rows and columns ‣ Writes scale linearly “to infinity” - Netflix benchmarked 1 million writes/s (EC2)

More Decks by David Dahl

Other Decks in Programming