Database Reference
In-Depth Information
The first of these stores is the simplest: a key-value store. There are many
different key-value stores, but Redis is one of the more popular options. It
has performance similar to that of Memcached, but provides native support
for higher order data structures that are very useful for many streaming
analysis applications. Although not natively distributed, it focuses on very
high-performance single-machine applications.
The next store is MongoDB, which is a document store. It is schema-less
and has proven popular for applications that maintain rich profiles or data
that can be naturally ordered into documents. It supports master-slave
replication as well as sharding (partitioning). It can support very high write
performance, also near Memcached levels, at the expense of safety. In
modern versions of the database, this tradeoff can be tuned at the client
level.
Finally, Cassandra is a decentralized database system that takes features
from both key-value stores and tabular databases using elements from both
Amazon's DynamoDB as well as Google's BigTable. Early versions suffered
from a difficult-to-use query language, which essentially exposed internal
data structures. However, more recent versions have introduced a much
more usable query language that strongly resembles SQL, making it a much
more viable option.
The rest of this section discusses the usage of each option in turn. The
questionofwhichoneisbestisleftlargelyunanswered.Thisisbecausethere
is no “best” technology for all applications. Does this mean that multiple
database technologies might be used in a single environment? Absolutely.
This is why the last few chapters have been concerned with building a
flexible data-flow system: Data needs to flow and be transformed between
systems.
Redis
Redis is a simultaneously simple and complicated key-value store. It is
simple in that it makes little attempt to solve two problems often solved
by key-value stores: working sets larger than main memory and distributed
storage. A Redis server can only serve data that fits in its main memory.
Although it has some replication facilities, it does not support features such
as eventual consistency, and even though Redis has been in the works for
some time, even sharding and consistent hashing are provided by outside
Search WWH ::




Custom Search