Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »



This page discusses the options of elastic persistence and how they compare

MongoDB

Main characteristics

  • BSON format (binary JSON), so more efficiency in data transfer and storage
  • C++
  • Apache license
  • Supports updates in-place, which means that no new documents have to be created but the existing document is modified. This improves the write performance a lot.
  • Adhoc queries, which means that indexes are not mandatory because in a lot of cases MongoDB can find an optimal query path.
  • Language specific drivers
  • Only atomic transactions
  • Master-Slave replication

Community

Questions

  • How to work with update commands?  Write side?  Is our idea valid?
  • How to test scalability?
  • How to deal with relations?
  • How to handle schema updates in the code?
  • How to make a versioned update like [update ... where oid = ... and version = 2] and then check how many documents were updated.

Links

Pros

  • BSON (binary JSON) instead of JSON, which optimizes the storage and communication of documents
  • Native drivers for a lot of languages (including Java, C++, C#, PHP, Javascript, Groovy etc)
  • Good support for queries
  • High read and write performance

Cons

  • Less durability (no crash-only design) because writes are not immediately synced with the file system. This means that the write performance is higher, but data can get lost after a crash. From version 1.7.5 journalling is supported which provides more durability, but this seems to be work-in-progress.

CouchDB

Main characteristics

  • JSON format
  • Erlang
  • Apache license
  • MVCC (Multi-Version Concurrency Control), which means that updates always result in new documents with a version+1. This leads to less performance in writes, but contributes to the crash-only design of CouchDB. This approach also enables you to use versioned updates, so you can check if the document still has the same version identifier to check if there was another update.
  • No adhoc query, so indexes have to be created
  • General REST interface that can be used for CRUD operations. There are several driver projects which make it easier to use the REST interface.
  • Only atomic transactions
  • Master-Master replication, which means that it's very well suited for offline work getting synced to the database server.

Community

Pros

  • Durable crash-only design, which makes sure no data gets lost after a crash
  • Versioning is natively supported with MVCC
  • Master-master replication for offline work
  • No additional drivers needed due to REST interface

Cons

  • JSON and REST interface make it less optimal in network traffic
  • Query support is more limited than with MongoDB

Redis

Main characteristics

  • Binary format
  • C/C++
  • BSD license
  • Writes (and also reads) are very fast, because Redis keeps a large in-memory set. The in-memory set is synced to disk at certain intervals (for example each 60 seconds).
  • Key-value pair database
  • Native language drivers
  • Transaction support
  • Master-Slave replication

Community

Links

Cassandra

Main characteristics

  • Binary format
  • Java
  • Apache license
  • Cassandra is designed to run on multiple servers, so its writing mechanism is mostly designed to replicate write actions across the network of servers.
  • Key-value pair database, query options are limited
  • Thrift communication protocol (binary)

Community

  • Apache project, Datastax provides support for Cassandra. In the PMC are employees of Facebook, Twitter, LinkedIn and Datastax
  • Active community with around 20 posts per day on the user list
  • Main users: Facebook, Twitter (not for the tweets), Rackspace, Cisco WebEx

Links

  • No labels