Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
96 views

Main Memory Databases

Main memory databases store data entirely in RAM rather than on disk storage. This provides faster access times than traditional disk-optimized databases since there is no disk I/O. However, main memory databases originally had limited adoption due to high memory costs. While caching can improve read performance for disk databases, it does not help write speeds and requires substantial resources. Modern main memory databases address persistence issues through techniques like transaction logging to disk and non-volatile RAM.

Uploaded by

Shrutika Chawla
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

Main Memory Databases

Main memory databases store data entirely in RAM rather than on disk storage. This provides faster access times than traditional disk-optimized databases since there is no disk I/O. However, main memory databases originally had limited adoption due to high memory costs. While caching can improve read performance for disk databases, it does not help write speeds and requires substantial resources. Modern main memory databases address persistence issues through techniques like transaction logging to disk and non-volatile RAM.

Uploaded by

Shrutika Chawla
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Main

Memory
Databases
Shrutika Chawla
Diksha Kalra
Introduction
• Also called In-memory databases,
Real-time database.
• Stores data entirely in main
memory.
• Introduced in early 80s, research
was limited because of high
memory costs.
Introduction
• Again gained traction in mid
2000s, due to multi-core
processors that can address large
memory and due to less
expensive RAM.
• Contrasts to traditional database
system which are designed for
data storage on persistent media.
Features
• Eradicates disk access by saving
and manipulating data in main
memory.
• Faster than disk-optimised
database because they carry
fewer CPU instructions.
• Commonly includes direct data
manipulation and a dedicated
If avoiding disk I/O is the
goal, why not achieve it
through database caching?
• In caching, on-disk databases keep
frequently accessed records in memory,
for faster access.
• However, caching only speeds up
‘database reads’.
• Any db write, i.e. an update to record or
creation of a new records must be
written through cache to disk.
• In addition, cache itself requires
substantial memory and CPU
resources, so even ‘cache-hit’ under
performs Main Memory Database.
Advantages
• the internal optimization algorithms
are simpler and execute fewer CPU
instructions.
• Data management is performed
orders of magnitude faster.
• Eradicates or minimizes disk access.
• Includes direct data manipulation
and a dedicated memory based
architecture.
Shortcomings
• Memory is volatile, i.e. as soon as the
system shuts down or crashes, the
data is lost.
• Lack of persistence.
• Main memories are less costly than
earlier times, but still expensive than
ROMs/disks/persistent storage.
Persistent In-Memory
Databases
• In-memory databases without
persistence are useless because all
the write changes are lost.
• Solution – combine the power of In-
memory db storage and good old
databases like MySQL or Postgres.
• Implemented through transaction-
logging.
• On normal shutdown, an in-memory
Persistent In-Memory
Databases
• When next re-opened, the previous
saved image is loaded and thereafter,
every transaction committed to the
in-memory database is also
appended to a transaction log file.
Persistent In-Memory
Databases
• If the system terminates abnormally, the
database can be recovered by re-loading
the original database image and replaying
the transactions from the transaction log
file.
• After an image is written to disk
successfully, the transactions
corresponding to it are flushed from the
transaction log to avoid unnecessary
memory occupation.
Persistent In-Memory
Databases
• Non-volatile RAM or NVRAM
provides another means of in-
memory database persistence.
• One type of NVRAM, called battery-
RAM, is backed up by a battery so
that even if a device is turned off or
loses its power source, the memory
content—including the database—
remains.

You might also like