What are low latency databases?

Definition

Ujjwal Gupta
3 min readJul 3, 2023

A low-latency database is a type of database management system that is designed to provide very fast response times. This means that when a user requests data from the database, the database will return the data very quickly, with minimal lag time. Low-latency databases are often used for applications that require real-time data access, such as trading systems, gaming platforms, and streaming media services.

How to measure latency?

IT organizations often do not consider latency holistically. This is because teams that test and monitor applications often focus on average performance measurements. This is understandable, as most application performance monitoring tools report averages by default. However, averages can mask latency outliers, which are extreme deviations from the norm that can have a significant impact on overall system performance.

Percentile-based metrics are a better measure of real-world performance than average performance measurements because they reflect the actual latency that occurred for a specific percentage of requests. For example, the 95th percentile latency is the latency that occurred for 95% of requests. This means that 5% of requests had a latency that was higher than the 95th percentile latency.

How can we remove the factors that contribute to high latency in databases?

High latency can be a problem for applications that require fast response times. One way to minimize latency is to choose the right type of database. NoSQL databases are often a good choice for applications that require low latency because they are designed to be more efficient than traditional relational database management systems (RDBMSs).

RDBMSs are designed to ensure that transactions are strongly consistent. This means that all changes to the database are made visible to all users at the same time. This can be important for applications that require a high degree of data consistency, such as financial applications. However, it can also add latency to transactions.

NoSQL databases, on the other hand, are designed to be more efficient. They often use a different consistency model than RDBMSs, such as eventual consistency. This means that changes to the database may not be visible to all users at the same time. However, this can also improve latency.

The distributed architecture of NoSQL databases helps to address latency by enabling deployment topologies that place data closer to globally distributed users, thus minimizing network latency. Similarly, NoSQL databases do not impose latency caused by locks. Database operations can be executed against nodes across the cluster relatively independently. Even though more copies of the data are stored across a cluster, the time to access that data is reduced, since the application waits only for the fastest nodes, without waiting for slower nodes to catch up.

Overall, the distributed architecture and the lack of locks in NoSQL databases can help to address latency. This makes them a good choice for applications that require low latency.

Promising Candidates for Low Latency Databases

Independent tests have shown that Apache HBase and Cassandra outperform MongoDB in terms of speed and latency. However, Cassandra has an Achilles heel: it is implemented in Java, which is a platform that is vulnerable to garbage collection (GC) pauses. GC pauses can cause significant performance degradation, and they can be more frequent in larger clusters. Additionally, compaction and repair operations can also add to performance outliers.

ScyllaDB is a NoSQL database that is designed for high performance and low latency. It is built in C++ instead of Java, which eliminates the costly garbage collection of managed code. ScyllaDB is also designed to maximize the power of modern high-speed hardware. It is asynchronous, which means that it can drive both I/O and CPU processing in a way that scales linearly with the number of CPU cores. This makes it possible for ScyllaDB to achieve very low latency.

--

--

Ujjwal Gupta

Passionate Software Engineer loves working on System Design Problems, working at Walmart Labs