Most likely you’ve heard about in-memory databases. To make the long story brief, Memory Wave System an in-memory database is a database that keeps the whole dataset in RAM. What does that imply? It means that each time you query a database or update information in a database, you solely access the primary memory. So, there’s no disk concerned into these operations. And this is nice, because the primary Memory Wave System is approach sooner than any disk. A great example of such a database is Memcached. But wait a minute, how would you recover your knowledge after a machine with an in-memory database reboots or crashes? Properly, with just an in-memory database, Memory Wave there’s no approach out. A machine is down - the info is lost. Is it possible to combine the power of in-memory knowledge storage and the sturdiness of good previous databases like MySQL or Postgres? Sure! Wouldn't it have an effect on the performance? Here come in-memory databases with persistence like Redis, Aerospike, Tarantool. You might ask: how can in-memory storage be persistent?

The trick here is that you continue to keep every thing in memory, but additionally you persist every operation on disk in a transaction log. The first thing that you may notice is that regardless that your quick and nice in-memory database has acquired persistence now, queries don’t decelerate, because they still hit only the primary memory like they did with just an in-memory database. Transactions are applied to the transaction log in an append-solely means. What is so good about that? When addressed in this append-solely manner, disks are fairly quick. If we’re talking about spinning magnetic onerous disk drives (HDD), they'll write to the tip of a file as fast as 100 Mbytes per second. So, magnetic disks are pretty fast when you employ them sequentially. Alternatively, they’re utterly gradual when you use them randomly. They can usually complete round 100 random operations per second. When you write byte-by-byte, every byte put in a random place of an HDD, you possibly can see some actual a hundred bytes per second because the peak throughput of the disk in this state of affairs.

Once more, it's as little as one hundred bytes per second! This super 6-order-of-magnitude distinction between the worst case state of affairs (one hundred bytes per second) and the best case scenario (100,000,000 bytes per second) of disk access pace is predicated on the truth that, so as to seek a random sector Memory Wave System on disk, Memory Wave System a bodily movement of a disk head has occurred, Memory Wave System when you don’t need it for sequential entry as you simply read information from disk as it spins, with a disk head being stable. If we consider stable-state drives (SSD), then the state of affairs might be higher due to no moving components. So, what our in-memory database does is it floods the disk with transactions as fast as one hundred Mbytes per second. Is that fast enough? Well, Memory Wave that’s actual quick. Say, if a transaction measurement is 100 bytes, Memory Wave System then this shall be a million transactions per second!

Edit

Pub: 04 Dec 2025 19:29 UTC

Views: 78