Cassandra vs MongoDB vs couchdb vs redis vs Riak vs hbase vs membase vs neo4j comparison

Source: Internet
Author: User
Tags cassandra riak neo4j couchdb stock prices

Original article address: Cassandra vs MongoDB vs couchdb vs redis vs Riak vs hbase vs membase vs neo4j comparison

Cassandra vs MongoDB vs couchdb vs redis vs Riak vs hbase vs membase vs neo4j comparison

While SQL databases are insanely useful tools, their monopoly ~ 15 years is coming to an end. And it was just time: I can't even count the things that were forced into relational databases, but never really fitted them.

But the differences between "nosql" databases are much bigger than it ever was between onesql database and another. This means that it is a bigger responsibility onsoftware extends tsto
Choose the appropriate one for a project right at the beginning.

In this light, here is a comparison ofcassandra, MongoDB, couchdb, redis, Riak, membase, neo4j
Andhbase:

Couchdb
    • written in: Erlang
    • main point: dB consistency, consistency of use
    • license: apache
    • Protocol: HTTP/rest
    • bi-directional (!) Replication,
    • continuous or ad-hoc,
    • with conflict detection,
    • thus, master-master replication .(!)
    • MVCC-write operations do not block reads
    • previous versions of statements are available
    • crash-only (reliable) design
    • needs compacting from time to time
    • views: Embedded MAP/reduce
    • formatting views: Lists & shows
    • server-side document validation possible
    • authentication possible
    • real-time updates via _ changes (!)
    • attachment handling
    • thus, couchapps (standalone JS Apps)
    • jquery library included

Best used:For accumulating, occasionally changing data, on which pre-defined queries are to be run. Places where Versioning is important.

For example:CRM, CMS systems. Master-master replication is an especially interesting feature, allowing easy multi-site deployments.

Redis
    • Written in:C/C ++
    • Main Point:Blazing fast
    • License:BSD
    • Protocol:Telnet-like
    • Disk-backed in-memory database,
    • But since 2.0, it can swap to disk. (going away after 2.4 !)
    • Master-slave Replication
    • Simple values or hash tables by keys,
    • But complex operations like zrevrangebyscore.
    • Incr & Co (good for Rate limiting or statistics)
    • Has sets (also Union/diff/Inter)
    • Has lists (also a queue; blocking pop)
    • Has hashes (Objects of multiple fields)
    • Sorted sets (high score table, good for range queries)
    • Redis has transactions (!)
    • Values can be set to expire (as in a cache)
    • Pub/sub lets one implement messaging (!)

Best used:For rapidly changing data with a foreseeable database size (shocould fit mostly in memory ).

For example:Stock prices. analytics. Real-time Data Collection. Real-time communication.

MongoDB
    • Written in:C ++
    • Main Point:Retains some friendly properties of SQL. (query, index)
    • License:Agpl (Drivers: Apache)
    • Protocol:Custom, binary (bson)
    • Master/Slave replication (Auto failover with replica sets)
    • Sharding built-in
    • Queries are Javascript expressions
    • Run arbitrary JavaScript Functions server-side
    • Better update-in-place than couchdb
    • Uses memory mapped files for data storage
    • Performance over features
    • Journaling (with -- journal) is best turned on
    • On 32bit systems, limited ~ 2.5 GB
    • An empty database takes up 192 MB
    • Gridfs to store big data + metadata (not actually an FS)

Best used:If you need dynamic queries. if you prefer to define indexes, not map/reduce functions. if you need good performance on a big dB. if you wanted couchdb, but your data changes too much, filling up disks.

For example:For most things that you wowould do with MySQL or PostgreSQL, but having predefined columns really holds you back.

Riak
    • written in: Erlang & C, some JavaScript
    • main point: Fault Tolerance
    • license: apache
    • Protocol: HTTP/rest or custom binary
    • tunable trade-offs for distribution and replication (n, R, W)
    • pre-and post-commit hooks in Javascript or Erlang, for validation and security.
    • MAP/reduce in Javascript or Erlang
    • links & link walking: use it as a graph database
    • indices: Put metadata in, search it (coming in 1.0)
    • large object support (Luwak)
    • comes in "Open Source" and "Enterprise" editions
    • full-text search, indexing, querying with Riak search server (Beta)
    • masterless multi-Site Replication replication and SNMP monitoring are both cially licensed

Best used:If you want something Cassandra-like (Dynamo-like), but no way you're gonna deal with the bloat and complexity. if you need very good single-site scalability, availability and fault-tolerance, but you're ready to pay for multi-site
Replication.

For example:Point-of-sales data collection. factory control systems. Places where even seconds of downtime hurt. cocould be used as a well-Update-able web server.

Membase
    • Written in:Erlang & C
    • Main Point:Memcache compatible, but with persistence and clustering
    • License:In Apache 2.0
    • Protocol:Memcached plus extensions
    • Very fast (200 K +/sec) Access of data by key
    • Persistence to disk
    • All nodes are identical (master-master replication)
    • Provides memcached-style in-memory caching buckets, too
    • Write de-duplication to reduce Io
    • Very nice cluster-management web GUI
    • Software upgrades without taking the DB offline
    • Connection proxy for Connection Pooling and multiplexing (Moxi)

Best used:Any application where low-latency data access, high concurrency support and high availability is a requirement.

For example:Low-latency use-cases like ad targeting or highly-concurrent web apps like online gaming (e.g. Zynga ).

Neo4j
    • Written in:Java
    • Main Point:Graph database-relationships
    • License:GPL, some features agpl/commercial
    • Protocol:HTTP/rest (or embedding in Java)
    • Standalone, or embeddable into Java applications
    • Both vertices and edges can have metadata
    • Nice self-contained Web Admin
    • Advanced Path-finding with multiple algorithms
    • Indexing of keys and relationships
    • Optimized for reads
    • Has transactions (in the Java API)
    • "Gremlin" Graph traversal Language
    • Scriptable in groovy
    • Online backup, advanced monitoring and high availability is agpl/commercial licensed

Best used:For graph-style data. neo4j is quite different from the others in this sense.

For example:Social relations, public transport links, road maps, network topologies.

Cassandra
    • Written in:Java
    • Main Point:Best of bigtable and Dynamo
    • License:Apache
    • Protocol:Custom, binary (thrift)
    • Tunable trade-offs for distribution and replication (n, R, W)
    • Querying by column, range of keys
    • Bigtable-like features: columns, column families
    • Writes are much faster than reads (!)
    • MAP/reduce possible with Apache hadoop
    • I admit being a bit biased against it, because of the bloat and complexity it has partly because of Java (configuration, seeing exceptions, etc)

Best used:When you write more than you read (logging). If every component of the system must be in Java. ("no one gets fired for choosing Apache's stuff .")

For example:Banking, Financial Industry (though not necessarily for financial transactions, but these industries are much bigger than that.) writes are faster than reads, so one natural niche is real time data analysis.

Hbase

(With the help of ghshephard)

    • Written in:Java
    • Main Point:Billions of rows x millions of Columns
    • License:Apache
    • Protocol:HTTP/rest (also thrift)
    • Modeled after bigtable
    • MAP/reduce with hadoop
    • Query predicate push down via server side scan and get Filters
    • Optimizations for real time queries
    • A high performance thrift Gateway
    • HTTP supports XML, protobuf, and binary
    • Cascading, hive, and pig Source and Sink modules
    • Jruby-based (jirb) Shell
    • No single point of failure
    • Rolling Restart for configuration changes and minor upgrades
    • Random Access performance is like MySQL

Best used:If you're in love with bigtable. And when you need random, realtime read/write access to your big data.

For example:Facebook messaging database (more general example coming soon)

Of course, all systems have much more features than what's listed here. I only wanted to list the key points that I base my decisions on. also, development of all are very fast, so things are bound to change. i'll do my best to keep this list updated.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.