Cassandra was developed at Facebook and some would say it's an intersection between Amazon's Dynamo and Google's BigTable. It's an open source distributed active-active NoSQL column-oriented data store with tuning capabilities that optimize for write-heavy workloads. It uses quorum reads and writes to balance consistency with availability and automatically manages replication of data - if a server fails, there is no availability loss assuming you've configured the right number of replicas. And when a new server is brought in to replace it, all Cassandra needs to know is the ip of the server it's replacing, and it'll manage getting the new server up to speed. Since Cassandra uses append-only writes, one of the tradeoffs made is that it doesn't allow for fast deletions - and deletions can actually increase the size of the data until compaction time.
Cassandra is different from what we were taught to be active-active databases. Most active-active setups are not good at scaling for higher write throughput because all writes have to go to all the primary(master) servers. With Cassandra, when a client connects, it can connect to any node in the cluster and that node will act as the coordinator for the duration of the session. All nodes know the mappings of row-key to key range to server, and each node is assigned to store data for some key range. When a request comes in, the chosen coordinator will forward the request (whether it's a read or write) to the correct set of replicas for the requested row-key. It'll use quorum reads/writes and send the correct response back to the client. For any writes that aren't able to be propagated to a server (e.g. it failed), the writes are buffered and written to it once it's back up - this is called
hinted handoff.
As everyone knows, SQL databases are starting to go out of style for many of todays most common workloads, but moreover even NoSQL is starting to be challenged - more and more systems require polyglot persistence systems. With this in mind, Cassandra is a powerful and tunable system used on its own or in concert with other storage technologies.
Comments
Post a Comment