Why Nutanix Adopted RocksDB + CassandraDB

Nutanix RocksDB Vs CassandraDB

Why Nutanix decided to adopt / use Nutanix RocksDB vs Apache Cassandra DB /? Lets explore the advantage and disadvantages of Rocks DB vs Cassandra DB. Nutanix recently adopted the RocksDB to handles the read and write burst bytes of NVMe Express ( Non-Volatile Memory express ) Storage Drives for Fastest I/O, left the Apache Cassandra DB behind for traditional SSD / HDD only. because Apache Cassandra DB is not efficient to handle then higher speed storage drives like NVMe or latest.

Nutanix core developers are working to customizing the RocksDB program code for Nutanix HCI platform to deliver the highest I/O operation to satisfied the latest storage drive NVMe SSD’s read / write speed of NVMe Express ( Non-Volatile Memory express ) drives.

What is Cassandra DB ?

Apache Cassandra is a free and open-source, distributed, wide column store, NoSQL database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple data-centers, with asynchronous master-less replication allowing low latency operations for all clients.

Cassandra DB Explain

Apache Cassandra DB Advantages

Why Nutanix adopted / uses Apache Cassandra DB ? what is the advantages of Apache Cassandra DB ? let explore the positive points of Nutanix customized Cassandra DB.

  • Apache Cassandra DB with unique capacity to deliver near real-time performance Apache Cassandra DB
  • Cassandra is Apache’s open-source project that is free to use / modify
  • Cassandra can be integrated with other Apache open-source projects like Hadoop (with the help of MapReduce), Apache Pig and Apache Hive
  • Cassandra follows a peer-to-peer architecture, instead of master-slave architecture
  • One of the biggest advantages of using Cassandra is its elastic scalability. Cassandra cluster can be easily scaled-up or scaled-down. Interestingly, any number of nodes can be added or deleted in Cassandra cluster without much disturbance
  • Cassandra has demonstrated brilliant performance under large sets of data
  • Cassandra has great feature of Data replication RF2 / RF3 which makes Cassandra highly available and fault-tolerant. Replication means each data is stored at more than one location. This is because, even if one node fails, the user should be able to retrieve the data with ease from another location. In a Cassandra cluster, each row is replicated based on the row key.
  • Cassandra DB is based on NoSQL Database technology
  • Cassandra DB support multiple programming languages like C#, C++, Clojure, Erlang, Go, Haskell, Java, JavaScript info, Perl, PHP, Python, Ruby, Scala
  • Cassandra DB solved the Big Data storage problem of Facebook and Instagram social networking sites.
  • Cassandra Query Language (CQL) is a close relative of SQL
  • Cassandra will automatically repartition as machines are added and removed from the cluster
  • Cassandra provide very high write throughput but good read throughput

Apache Cassandra DB Disadvantages

Nutanix customized Cassandra DB has some disadvantages and/or limits that does not compatible to match the latest technology high speed storage drives like NVMe SSD drives. Lets explore the disadvantages / limitations of Nutanix Cassandra DB.

  • Cassandra has big issue with Data Read Latency
  • Hard to tune-up for both latency and throughput
  • Highly depended on Work load and type
  • Max 20 % P99 latency drop
  • Most memory consumed by storage engine
  • To store huge amount of data, JVM is required to manage the memory to clean up garbage collection that is not done by the application but by a language in Cassandra

Don’t Use Cassandra DB – Use Cases

Cassandra is not recommended if you have following use cases :

  • you are not storing volumes of data across racks of clusters.
  • if you have a strong requirement for ACID properties.
  • if you want to use aggregate function.
  • if you are not partitioning your servers.
  • if you are application has more read requests than writes.
  • if you require strong Consistency.

What is RocksDB ?

RocksDB was developed by the Facebook to handle the read and write burst of data for high performance purpose. RocksDB is an embedded database to using persistent key value store. which enables faster storage access to retrieving data in real-time.

RocksDB is written in C++ and it supports API bindings for C++, C, Java, Python, PHP, as well as many other third-party language bindings. RocksDB is used in production in several large companies such as Facebook, Yahoo!, and LinkedIn. Read more about RocksDB

Rocks DB

RocksDB Advantages

Why Nutanix adopted / use RocksDB ? what are the advantages and disadvantages of RocksDB ? lets explore the points.

High Performance : RocksDB uses a log structured database engine, written entirely in C++, for maximum performance. Keys and values are just arbitrarily-sized byte streams.

RocksDB software can fully utilize the IOPS offered by flash storage, making it perform faster than LevelDB across random read, write, and bulk uploads. We’ve seen it perform 10 times faster for a pure random write workload and a bulk upload, as well as 30% faster for a pure random read workload. 

RocksDB Architecture
RocksDB Architecture

Optimized for Fast Storage : RocksDB is optimized for fast, low latency storage such as flash drives and high-speed disk drives. RocksDB exploits the full potential of high read/write rates offered by flash or RAM.

Adaptable Database Engine : RocksDB is adaptable to different workloads. From database storage engines such as MyRocks to application data caching to embedded workloads, RocksDB can be used for a variety of data needs.

RocksDB especially suited for storing data on flash drives. It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF) and Space-Amplification-Factor (SAF). It has multi-threaded compactions, making it specially suitable for storing multiple terabytes of data in a single database. Download RocksDB Open Source Binary

RocksDB uses a Log Structured Database Engine for storage and features very flexible, tunable configuration settings that allow it to operate in a variety of production environments, including pure DRAM memory and Flash, using standard or distributed file systems such as HDFS.

Rocks DB File Blocks
Rocks DB file Blocks

RocksDB supports IO-bound, in-memory, and write-once workloads : An IO-bound workload is one where the database size is much larger than memory and there are frequent reads from storage. An in-memory workload is one where the database fits entirely in memory and can still use storage to persist the database after changes.

A write-once workload is one where the majority of the keys are written once or insert-only without updates. Today, RocksDB supports an IO-bound workload optimally. There has been a lot of work to make RocksDB better for in-memory support.

Cluster re-balancing on node failure or node addition becomes extremely efficient because the SSTable files of tablets being re-balanced. RocksDB FAQ

RocksDB Disadvantages

RocksDB has few disadvantages: RocksDB isn’t a distributed database–rather the focus is on making an efficient, high-performance, single-node database engine but Apache Cassandra DB use distributed database across nodes in the cluster.

  • SSD/Flash is getting affordable, but MLC Flash is still a bit expensive
  • HDD: Large enough capacity but very limited IOPS
  • Reducing read/write IOPS is very important — Reducing write is harder
  • SSD/Flash: Great read iops but limited space and write endurance
  • Reducing space is higher priority

RocksDB Use Cases

RocksDB Use cases: RocksDB can be used by applications that need low-latency database accesses. Some examples include: 

  • A user-facing application that stores the viewing history and state of users of a website. 
  • A spam-detection application that needs fast access.
  • A graph-search query that needs to scan a data set in real time. 
  • An app that needs to query Hadoop in real time. 
  • A message-queue that supports a high number of inserts and deletes.

Conclusion

RocksDB vs Apache Cassandra DB both has its own advantages / disadvantages to using them but both Database has specific use case scenarios to use and can work with high I/O performance. RocksDB is best suited for Non-distributed and higher speed storage drives like NVMe while Apache Cassandra DB is best suited for traditional SSD and HDD along with distributed architecture with data redundancy ( RF2 / RF3 ).