Cockroach: Replace RocksDB with FoundationDB

Created on 1 May 2018  路  3Comments  路  Source: cockroachdb/cockroach

FEATURE REQUEST
Now that FoundationDB is open source again, how difficult would it be to use CockroachDB's SQL layer on top of FoundationDB's K/V store?

There seems to be a lot of interest in the FoundationDB forum for this and it seems like there could be a lot of overlap since CockroachDB is already using a sorted key-value store.

C-enhancement O-community

Most helpful comment

@magaldima RocksDB and FoundationDB are very different beasts. RocksDB is a low-level, non-distributed KV store. FoundationDB is a distributed, transactional KV store. It would be perfectly reasonable for FoundationDB to use RocksDB internally for per-node data storage. The speed and robustness of RocksDB is one of the reasons it is seeing usage as the low-level data storage engine inside MySQL (MyRocks), MongoDB (MongoRocks) and Cassandra.

Now that FoundationDB is open source again, how difficult would it be to use CockroachDB's SQL layer on top of FoundationDB's K/V store?

The short answer: very very difficult. CockroachDB's SQL layer is intimately tied to CockroachDB's KV layer. Separating the two would be an extremely large undertaking. Internally CockroachDB has a distributed, transactional KV layer that is very much akin to FoundationDB, but it is isn't exposed for direct use because we made a decision to focus our efforts on supporting SQL rather than supporting both SQL and a KV API. Note that CockroachDB's KV layer is much more than just RocksDB.

Could CockroachDB's SQL layer be used on top of FoundationDB's KV store? Yes, with a ton of work. You'd need so many modifications that you might as well fork CockroachDB's SQL layer and consider it something new. I would question the wisdom in doing this as CockroachDB's SQL layer is still undergoing rapid development.

Turning your question around: what do you hope to achieve by using CockroachDB's SQL layer on top of FoundationDB? There might be an easier path forward by incorporating ideas from FoundationDB into CockroachDB.

Sorry to throw cold water on this request.

All 3 comments

@magaldima RocksDB and FoundationDB are very different beasts. RocksDB is a low-level, non-distributed KV store. FoundationDB is a distributed, transactional KV store. It would be perfectly reasonable for FoundationDB to use RocksDB internally for per-node data storage. The speed and robustness of RocksDB is one of the reasons it is seeing usage as the low-level data storage engine inside MySQL (MyRocks), MongoDB (MongoRocks) and Cassandra.

Now that FoundationDB is open source again, how difficult would it be to use CockroachDB's SQL layer on top of FoundationDB's K/V store?

The short answer: very very difficult. CockroachDB's SQL layer is intimately tied to CockroachDB's KV layer. Separating the two would be an extremely large undertaking. Internally CockroachDB has a distributed, transactional KV layer that is very much akin to FoundationDB, but it is isn't exposed for direct use because we made a decision to focus our efforts on supporting SQL rather than supporting both SQL and a KV API. Note that CockroachDB's KV layer is much more than just RocksDB.

Could CockroachDB's SQL layer be used on top of FoundationDB's KV store? Yes, with a ton of work. You'd need so many modifications that you might as well fork CockroachDB's SQL layer and consider it something new. I would question the wisdom in doing this as CockroachDB's SQL layer is still undergoing rapid development.

Turning your question around: what do you hope to achieve by using CockroachDB's SQL layer on top of FoundationDB? There might be an easier path forward by incorporating ideas from FoundationDB into CockroachDB.

Sorry to throw cold water on this request.

I don't know what OP had in mind, and I don't know much about database engineering in general, but I think some of the excitement over FoundationDB is that multiple databases can sit atop the same key-value store. So you could set up one cluster and have a SQL database, a search database, a key-value database, a graph database, etc. all running on the same distributed cluster.

@jazoom Thanks for the additional color, though it doesn't change my response that using CockroachDB's SQL layer on top of FoundationDB would be very difficult.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

otan picture otan  路  4Comments

richardanaya picture richardanaya  路  3Comments

awoods187 picture awoods187  路  3Comments

couchand picture couchand  路  3Comments

petermattis picture petermattis  路  4Comments