Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

In-Memory DataBase


Published on

Published in: Education, Technology

In-Memory DataBase

  1. 1. In Memory Database (IMDB) (old is new again) Kodamasimham Pridhvi MT2012066
  2. 2. Agenda › Introduction › Architecture of IMDB › Practical Application › Myths about IMDB’s › IMDB vs. DRDB › Impact of IMDB › Challenges in IMDB › IMDB Open Sources
  3. 3. Introduction › What is In-Memory Data Base(IMDB)? An IMDB also called Main memory Database(MMDB) is a database whose primary data store is main memory.
  4. 4. History › Is this a new idea? NO!!! › Why now so important? Due to 4 factors
  5. 5. Factors: › LOWER ING COSTS & GROWING SIZE (RAM): – In early 2000, the cost of 64 MB RAM @ $71 – But now , 8GB DDR3 @ $69.99 › MULTICORE PROCESSORS – parallel and faster computation › 64 bit Computing – multiple GB of main memory › Faster responses to queries
  6. 6. Architecture Application SQL Engine Query Optimizer Memory Address Index and Data Manager Data Store Primary Storage of Data Base Lock , Log Logs/Redo/Ckpt Secondary Storage In – Memory Database Recovery Purpose
  7. 7. Practical Application › Applications that demand very fast data access, storage and manipulation › In real-time embedded systems › Music databases in MP3 players › Programming data in set-top boxes › e-commerce and social networking sites › financial services and many more…
  8. 8. IMDB vs. DRDB(Disk Resident DB) Disk Resident Data Base In-Memory Data Base Carries File I/O burden No file I/O burden Extra memory For Cache No extra memory Algorithm optimized for disk Algorithms optimized for memory More CPU cycles Less CPU cycles Assumes Memory is abundant Uses memory more efficiently
  9. 9. Myths about IMDB’s › Given the same amount of RAM, disk DBs can perform at the same speed as IMDBs (by using caching technology). › If a RAM disk is created and a traditional disk DB is deployed on it, it delivers the same performance as an in-memory database.
  10. 10. Myths about IMDB’s › In-memory database the same as an embedded database. › Since RAM size is limited, sizes of IMDBs are also limited.
  11. 11. Impact of IMDB: › Data Representation, › Concurrency control, › Data Access Methods, › Query Processing, › ACID Properties, › Recovery.
  12. 12. Data Representation › In Disk Resident DB, we use flat files and sequential access. › In IMDB, Relational tuples with direct pointers. – Space efficient. – Shared between columns and relations
  13. 13. Data Representation Diagram Relation Tuple Domain Table Marks Value 1 Age Value 2 Pointers To memory address Value 3 RollNo Age RollNo Age Age Relational Tuple
  14. 14. Concurrency Control(lock based) › In DRDB , locking granules are low level. – To reduce contention › In IMDB, due to fast processing it create coarser locks. – locking granules like a relation or entire database. – No need of hash table look up.
  15. 15. Data Access Methods › In DRDB, B-tree index structure is used. – ranges , exact match queries – lies in hard disk › In IMDB, T-tree index structure is explicitly designed – reduces the CPU processing – Eliminates index value compression and expansion
  16. 16. T-tree › T-tree node consists – ordered elements in the range min and max values – two pointers to the left and right nodes Pointer to parent Parent Key 1 Minimum Element Left ptr …………….. Control Key.. Key n Maximum Element Right ptr
  17. 17. Query Processing › In DRDB, main focus is on processing costs, and attempt to minimize disk access. › In IMDB, main factors are – – – – Cardinality of table Presence of index Any ORDER BY clause Predicate evaluation › Ex : TimesTen provides range, hash and bitmap indexes and support two types of join methods nested-loop and merge-join.
  18. 18. ACID Properties › IMDBs can be said to lack support for the durability portion of the ACID › Many MMDBs have added durability via the following mechanisms: – Checkpoints – Transaction logging – NVRAM(Non-Volatile RAM)
  19. 19. Recovery › Mechanisms for recovery are : – Logging – Checkpoints – Reloading › transactional durability is kept, by keeping two separate but synchronized copies of the database at all times as well as storing log files on-disk.
  20. 20. Challenges in IMDB › Durability › Query optimization › Size of Data Base
  21. 21. IMDB Open Sources: › CSQL › HyperSQL › VoltDB › Mcobject › MonetDB