Databases Reference
In-Depth Information
event loop
RAM
Redis
VM System
Disk
FIGURE 4-14
WHY DOESN'T REDIS RELY ON OPERATING SYSTEM
VIRTUAL MEMORY SWAPPING?
Redis doesn't rely on operating system swapping because:
Redis objects don't map one-to-one with swap pages. Swap pages are 4,096
bytes long and Redis objects could span more than one page. Similarly, more
than one Redis object could be in a single swap page. Therefore, even when
a small percentage of the Redis objects are accessed, it's possible a large
number of swap pages are touched. Operating system swapping keeps track of
swap page access. Therefore, even if a byte in a swap page is accessed it is left
out by the swapping system.
Unlike MongoDB, Redis data format when in RAM and in disk are not
similar. Data on disk is compressed way more as compared to its RAM
counterpart. Therefore, using custom swapping involves less disk I/O.
Salvatore Sanfi llipo, the creator of Redis, talks about the Redis virtual memory
system in his blog post titled, “Redis Virtual Memory: the story and the code,” at
http://antirez.com/post/redis-virtual-memory-story.html .
Next and last of all, attention is diverted back to column-oriented databases. However, this time it's
a special class of column-oriented databases, those that are eventually consistent.
EVENTUALLY CONSISTENT NON-RELATIONAL DATABASES
Whereas Google's Bigtable serves as the inspiration for column databases, Amazon's Dynamo
acts as the prototype for an eventually consistent store. The ideas behind Amazon Dynamo were
presented in 2007 at the Symposium on Operating Systems Principles and were made available to
Search WWH ::




Custom Search