Overview page and yellow theme

This commit is contained in:
James Pearce 2013-11-13 20:40:05 -08:00
parent 9ae624a7e7
commit f48c540e01
4 changed files with 158 additions and 75 deletions

View File

@ -30,77 +30,80 @@
<a class='button' href='overview.html'>Get Started</a>
</hgroup>
<aside>
<img src='static/rocksdbhero.png' />
<a href='overview.html'>
<img src='static/rocksdbhero.png' />
</a>
</aside>
</div></header>
<section class='content'><div class='width'>
<article>
<h2>What is RocksDB?</h2>
<p>
RocksDB is an embeddable persistent key-value store for fast
storage. RocksDB can also be the foundation for a client-server
database but our current focus is on embedded workloads.
<p>
<p>
RocksDB builds on <a
href='https://code.google.com/p/leveldb/'>LevelDB</a> to be scalable
to run on servers with many CPU cores, to efficiently use
fast storage, to support IO-bound, in-memory and write-once
workloads, and to be flexible to allow for innovation.
</p>
<h2>How does performance compare?</h2>
<p>
We benchmarked LevelDB and found that it was unsuitable for our
server workloads. The <a
href='http://leveldb.googlecode.com/svn/trunk/doc/benchmark.html'>
benchmark results</a> look awesome at first sight, but we quickly
realized that those results were for a database whose size was
smaller than the size of RAM on the test machine - where the entire
database could fit in the OS page cache. When we performed the same
benchmarks on a database that was at least 5 times larger than main
memory, the performance results were dismal.
</p>
<p>
By contrast, we've published the <a
href='https://github.com/facebook/rocksdb/wiki/Performance-Benchmarks'>
RocksDB benchmark results</a> for server side workloads on Flash. We
also measured the performance of LevelDB on these server-workload
benchmarks and found that RocksDB solidly outperforms LevelDB for
these IO bound workloads. We found that LevelDB's single-threaded
compaction process was insufficient to drive server workloads. We
saw frequent write-stalls with LevelDB that caused 99-percentile
latency to be tremendously large. We found that mmap-ing a file into
the OS cache introduced performance bottlenecks for reads. We could
not make LevelDB consume all the IOs offered by the underlying Flash
storage.
</p>
<h2>What is RocksDB?</h2>
<h2>What is RocksDB suitable for?</h2>
<p>
RocksDB can be used by applications that need low latency database
accesses. A user-facing application that stores the viewing history
and state of users of a website can potentially store this content
on RocksDB. A spam detection application that needs fast access to
big data sets can use RocksDB. A graph-search query that needs to
scan a data set in realtime can use RocksDB. RocksDB can be used to
cache data from Hadoop, thereby allowing applications to query
Hadoop data in realtime. A message-queue that supports a high number
of inserts and deletes can use RocksDB.
</p>
<p>
RocksDB is an embeddable persistent key-value store for fast storage. RocksDB
can also be the foundation for a client-server database but our current focus is
on embedded workloads.
</p>
<h2>Why is RocksDB open sourced?</h2>
<p>
We are open sourcing this project <a
href='http://github.com/facebook/rocksdb'>on GitHub</a> because we
think it will be useful beyond Facebook. We are hoping that software
programmers and database developers will use, enhance, and customize
RocksDB for their use-cases. We would also like to engage with the
academic community on topics related to efficiency for modern
database algorithms.
</p>
<p>
RocksDB builds on <a href='https://code.google.com/p/leveldb/'>LevelDB</a> to be
scalable to run on servers with many CPU cores, to efficiently use fast storage,
to support IO-bound, in-memory and write-once workloads, and to be flexible to
allow for innovation.
</p>
<h2>How does performance compare?</h2>
<p>
We benchmarked LevelDB and found that it was unsuitable for our server
workloads. The <a
href='http://leveldb.googlecode.com/svn/trunk/doc/benchmark.html'> benchmark
results</a> look awesome at first sight, but we quickly realized that those
results were for a database whose size was smaller than the size of RAM on the
test machine - where the entire database could fit in the OS page cache. When we
performed the same benchmarks on a database that was at least 5 times larger
than main memory, the performance results were dismal.
</p>
<p>
By contrast, we've published the <a
href='https://github.com/facebook/rocksdb/wiki/Performance-Benchmarks'> RocksDB
benchmark results</a> for server side workloads on Flash. We also measured the
performance of LevelDB on these server-workload benchmarks and found that
RocksDB solidly outperforms LevelDB for these IO bound workloads. We found that
LevelDB's single-threaded compaction process was insufficient to drive server
workloads. We saw frequent write-stalls with LevelDB that caused 99-percentile
latency to be tremendously large. We found that mmap-ing a file into the OS
cache introduced performance bottlenecks for reads. We could not make LevelDB
consume all the IOs offered by the underlying Flash storage.
</p>
<h2>What is RocksDB suitable for?</h2>
<p>
RocksDB can be used by applications that need low latency database accesses. A
user-facing application that stores the viewing history and state of users of a
website can potentially store this content on RocksDB. A spam detection
application that needs fast access to big data sets can use RocksDB. A
graph-search query that needs to scan a data set in realtime can use RocksDB.
RocksDB can be used to cache data from Hadoop, thereby allowing applications to
query Hadoop data in realtime. A message-queue that supports a high number of
inserts and deletes can use RocksDB.
</p>
<h2>Why is RocksDB open sourced?</h2>
<p>
We are open sourcing this project <a
href='http://github.com/facebook/rocksdb'>on GitHub</a> because we think it will
be useful beyond Facebook. We are hoping that software programmers and database
developers will use, enhance, and customize RocksDB for their use-cases. We
would also like to engage with the academic community on topics related to
efficiency for modern database algorithms.
</p>
</article>

View File

@ -34,13 +34,19 @@
<article>
<h2>Opening A Database</h2>
<p>
A <code>rocksdb</code> database has a name which corresponds to a
file system directory. All of the contents of database are stored in
this directory. The following example shows how to open a database,
creating it if necessary:
</p>
<p> The <code>rocksdb</code> library provides a persistent key value store. Keys
and values are arbitrary byte arrays. The keys are ordered within the key value
store according to a user-specified comparator function. </p>
<p> The library is maintained by the Facebook Database Engineering Team, and is
based on leveldb, by Sanjay Ghemawat and Jeff Dean at Google. </p>
<h2>Opening A Database</h2>
<p> A <code>rocksdb</code> database has a name which corresponds to a file
system directory. All of the contents of database are stored in this directory.
The following example shows how to open a database, creating it if necessary:
</p>
<pre>#include &lt;assert&gt;
#include "rocksdb/db.h"
@ -48,18 +54,79 @@
rocksdb::DB* db;
rocksdb::Options options;
options.create_if_missing = true;
rocksdb::Status status = rocksdb::DB::Open(options, "/tmp/testdb", &amp;db);
rocksdb::Status status =
rocksdb::DB::Open(options, "/tmp/testdb", &amp;db);
assert(status.ok());
...</pre>
<p>
If you want to raise an error if the database already exists, add
the following line before the <code>rocksdb::DB::Open</code> call:
</p>
<p>
If you want to raise an error if the database already exists, add the following
line before the <code>rocksdb::DB::Open</code> call:
</p>
<pre>options.error_if_exists = true;</pre>
<h2>etc...</h2>
<h2>Status</h2>
<p>
You may have noticed the <code>rocksdb::Status</code> type above. Values of this
type are returned by most functions in <code>rocksdb</code> that may encounter
an error. You can check if such a result is ok, and also print an associated
error message:
</p>
<pre>rocksdb::Status s = ...;
if (!s.ok()) cerr &lt;&lt; s.ToString() &lt;&lt; endl;</pre>
<h2>Closing A Database</h2>
<p>
When you are done with a database, just delete the database object. For example:
</p>
<pre>/* open the db as described above */
/* do something with db */
delete db;</pre>
<h2>Reads And Writes</h2>
<p>
The database provides <code>Put</code>, <code>Delete</code>, and
<code>Get</code> methods to modify/query the database. For example, the
following code moves the value stored under <code>key1</code> to
<code>key2</code>.
</p>
<pre>std::string value;
rocksdb::Status s = db-&gt;Get(rocksdb::ReadOptions(), key1, &amp;value);
if (s.ok()) s = db-&gt;Put(rocksdb::WriteOptions(), key2, value);
if (s.ok()) s = db-&gt;Delete(rocksdb::WriteOptions(), key1);</pre>
<h2>Further documentation</h2>
<p>
These are just simple examples of how RocksDB is used. The full documentation is
available within the
<a href='https://github.com/facebook/rocksdb/blob/master/doc/'><code>/doc</code></a>
folder of the project.
</p>
<p>
In addition, further details about the RocksDB implementation may be found in
the following documents:
</p>
<ul>
<li><a href='https://github.com/facebook/rocksdb/wiki/_pages'>
RocksDB Project Wiki</a></li>
<li><a href='https://github.com/facebook/rocksdb/wiki/Rocksdb-Architecture-Guide'>
Architecture Guide</a></li>
<li><a href='https://github.com/facebook/rocksdb/wiki/Rocksdb-Table-Format'>
Format of an immutable Table file</a></li>
<li> <a href='https://github.com/facebook/rocksdb/blob/master/doc/log_format.txt'>
Format of a log file</a></li>
</ul>
</article>
</div></section>

View File

@ -5,7 +5,20 @@ header.topbar h1 {
background-size: 188px 55px;
}
header.hero {
background: #FFE084;
}
header.hero hgroup h1 {
color: #000;
}
header.hero hgroup a.button {
background: #000;
color: #ffbe00;
}
header.hero aside img {
border: solid 1px #fff;
box-shadow: 0 2px 10px #000;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 27 KiB