Dynamo
• Simple Key/Value store
• No master node
• Write to any (many) nodes
• Read from one or more nodes (balance
speed vs. consistency)
• Read repair
Dynamo
• Open-source clones
• Project Voldemort
• Cassandra - data model more like
BigTable
• Dynomite
memcached
• Used as a caching layer
• Essentially a key/value store
• RAM only - fast
• Does away with ACID
Redis
• Like memcached
• Different
• Values can be strings, lists, sets
• Non-volatile
Tokyo Cabinet + Tyrant
• Key/value store with focus on speed
• Some more advanced queries
• Sorting, range or prefix matching
• Multiple storage engines
• Hash, B-Tree, Fixed length and Table
• A lot in common with MongoDB:
• Document-oriented
• Schema-free
• JSON-style documents
• Differences
• MVCC based
• Replication as path to scalability
• Query through predefined views
• ACID
• REST
• Focus on performance
• Rich dynamic queries
• Secondary indexes
• Replication / failover
• Auto-sharding
• Many platforms / languages supported
Good at
• The web
• Caching
• High volume / low value
• Scalability
Less good at
• Highly transactional
• Ad-hoc business intelligence
• Problems that require SQL
PyMongo
• Python driver for MongoDB
• Pure Python, with optional C extension
• Installation
• Use setuptools:
easy_install pymongo
Basics
• Connect:
• Insert:
• Query:
Document values
• None
• Special values:
• bool
• SON
• int
• Binary
• float
• ObjectId
• string / unicode
• DBRef
• dict
• datetime.datetime
• compiled re
0 comments
Post a comment