diff --git a/index.html b/index.html index d8de14f31..11ec9bbf6 100644 --- a/index.html +++ b/index.html @@ -30,77 +30,80 @@ Get Started
-

What is RocksDB?

-

- 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. -

-

- RocksDB builds on LevelDB 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. -

-

How does performance compare?

-

- We benchmarked LevelDB and found that it was unsuitable for our - server workloads. The - benchmark results 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. -

-

- By contrast, we've published the - RocksDB benchmark results 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. -

+

What is RocksDB?

-

What is RocksDB suitable for?

-

- 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. -

+

+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. +

-

Why is RocksDB open sourced?

-

- We are open sourcing this project on GitHub 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. -

+

+RocksDB builds on LevelDB 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. +

+ +

How does performance compare?

+ +

+We benchmarked LevelDB and found that it was unsuitable for our server +workloads. The benchmark +results 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. +

+ +

+By contrast, we've published the RocksDB +benchmark results 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. +

+ +

What is RocksDB suitable for?

+ +

+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. +

+ +

Why is RocksDB open sourced?

+ +

+We are open sourcing this project on GitHub 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. +

diff --git a/overview.html b/overview.html index 20cf6d049..221cba646 100644 --- a/overview.html +++ b/overview.html @@ -34,13 +34,19 @@
-

Opening A Database

-

- A rocksdb 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: -

+

The rocksdb 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.

+ +

The library is maintained by the Facebook Database Engineering Team, and is +based on leveldb, by Sanjay Ghemawat and Jeff Dean at Google.

+ +

Opening A Database

+ +

A rocksdb 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: +

#include <assert>
 #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", &db);
+rocksdb::Status status =
+  rocksdb::DB::Open(options, "/tmp/testdb", &db);
 assert(status.ok());
 ...
-

- If you want to raise an error if the database already exists, add - the following line before the rocksdb::DB::Open call: -

+

+If you want to raise an error if the database already exists, add the following +line before the rocksdb::DB::Open call: +

options.error_if_exists = true;
-

etc...

+

Status

+ +

+You may have noticed the rocksdb::Status type above. Values of this +type are returned by most functions in rocksdb that may encounter +an error. You can check if such a result is ok, and also print an associated +error message: +

+ +
rocksdb::Status s = ...;
+if (!s.ok()) cerr << s.ToString() << endl;
+ +

Closing A Database

+ +

+When you are done with a database, just delete the database object. For example: +

+ +
/* open the db as described above */
+/* do something with db */
+delete db;
+ +

Reads And Writes

+ +

+The database provides Put, Delete, and +Get methods to modify/query the database. For example, the +following code moves the value stored under key1 to +key2. +

+ +
std::string value;
+rocksdb::Status s = db->Get(rocksdb::ReadOptions(), key1, &value);
+if (s.ok()) s = db->Put(rocksdb::WriteOptions(), key2, value);
+if (s.ok()) s = db->Delete(rocksdb::WriteOptions(), key1);
+ +

Further documentation

+ +

+These are just simple examples of how RocksDB is used. The full documentation is +available within the +/doc +folder of the project. +

+ +

+In addition, further details about the RocksDB implementation may be found in +the following documents: +

+ + +
diff --git a/static/rocksdb.css b/static/rocksdb.css index f6fe4e300..76b535aea 100644 --- a/static/rocksdb.css +++ b/static/rocksdb.css @@ -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; } \ No newline at end of file diff --git a/static/rocksdbhero.png b/static/rocksdbhero.png index 8a8d73f7c..5099ed34c 100644 Binary files a/static/rocksdbhero.png and b/static/rocksdbhero.png differ