1 / 31

B-Tree Structures over Flash Memory

B-Tree Structures over Flash Memory. Speaker: 吳晋賢 (Chin-Hsien Wu) Embedded Computing and Applications Lab Department of Electronic Engineering National Taiwan University of Science and Technology, Taipei, Taiwan. Outline. Introduction Flash Memory Characteristics

maisie
Download Presentation

B-Tree Structures over Flash Memory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. B-Tree Structures over Flash Memory Speaker: 吳晋賢(Chin-Hsien Wu) Embedded Computing and Applications Lab Department of Electronic Engineering National Taiwan University of Science and Technology, Taipei, Taiwan

  2. Outline • Introduction • Flash Memory Characteristics • Efficient B-Tree Index Structures over Flash Memory • Conclusion

  3. Introduction • Storage Systems • Embedded Systems or General Operating Systems • File Systems • An interface for information retrieval and access. • Physical Devices • A persistent (non-volatile) storage. • Benefits of Flash Memory as Storage Systems • Shock Resistant • No mechanical gadgets. • Non-Volatile • Persistent across power-failures. • Power Economic • Relatively to hard-disks. Flash Memory is a good storage device for storage systems!

  4. Introduction • Small updates could deteriorate flash-memory storage systems. • B-Tree index structures over flash memory. We aim at resolving these issues over flash memory storage systems!

  5. Outline • Introduction • Flash Memory Characteristics • Efficient B-Tree Index Structures over Flash Memory • Conclusion

  6. Flash Memory Characteristics Organization of a Typical NAND Flash MemoryErase a block time (2ms) > Write a page time (200us) > Read a page time (50us) Spare Area 16B 1 Page = 512B + 16B 1 Block = 32 pages User Area 512B Read/Write one page Block 0 Block 1 Block 2 Erase one block Block 3 … …

  7. Flash Memory Characteristics Example 1: Out-place Update A B C D Live pages Free pages Suppose that we want to update data A and B…

  8. Flash Memory Characteristics Example 1: Out-place Update A B C D A B Dead pages

  9. Flash Memory Characteristics L D D L D D L D This block is to be recycled. (3 live pages and 5 dead pages) L L D L L L F D L F L L L L D F A live page F L L F L L F D A dead page A free page Example 2:Garbage Collection

  10. Flash Memory Characteristics Example 2:Garbage Collection D D D D D D D D Live data are copied to somewhere else. L L D L L L L D L F L L L L D L A live page L L L F L L F D A dead page A free page

  11. Flash Memory Characteristics Example 2:Garbage Collection F F F F F F F F • The block is then erased. • Overheads: • live data copying • block eraseing. L L D L L L L D L F L L L L D L A live page L L L F L L F D A dead page A free page

  12. Flash Memory Characteristics

  13. Flash Translation Layer (FTL) Flash Memory Characteristics

  14. Outline • Introduction • Flash Memory Characteristics • Efficient B-Tree Index Structures over Flash Memory • Conclusion

  15. Why Research On Index Structures Over Flash Memory ? • Now, a 16G bit NAND flash-memory chip (SAMSUNG K9WAG08U1M flash memory chips) is available in the market. • Flash memory could be considered as an alternative to hard disks in many applications. • The implementation of index structures, which are very popular in the organization of data on disks, must be considered regarding flash memory.

  16. Efficient B-Tree Index Structures over Flash Memory • B-Tree • B-Tree is one of the most popular data structures adopted by database applications or databases systems (such as IBM DB2, Informix, Microsoft SQL Server, Oracle 8, and Sybase ASE), or even many well-known journaling file systems (such as XFS, JFS, and ReiserFS *) • The implementation of B-Tree index structures, which provide efficient data access on disks, must be considered regarding flash memory.

  17. Efficient B-Tree Index Structures over Flash Memory • Motivation A B-Tree Example

  18. Efficient B-Tree Index Structures over Flash Memory • Motivation • For disk storage systems: • A B-Tree node occupies a fixed number of sectors. • Large chunks are fetched from/committed to disks. • It is very efficient for disk storage systems to do this. • For flash-memory storage systems: • Intensively byte-wise operations are needed for B-Tree. • A page must be written even if few bytes are modified. • Free space is consumed very quickly due to the adoption of out-place updates. • Garbage collection will be triggered frequently, and the lifetime of flash memory is reduced severely.

  19. I1 I2 I3 I4 I5 I6 20 25 85 180 185 250 IndexUnit Sector 1 Sector 2 Efficient B-Tree Index Structures over Flash Memory Flash Translation Layer (FTL)

  20. Efficient B-Tree Index Structures over Flash Memory I1 I2 I3 I4 I5 I6 20 25 85 180 185 250 IndexUnit Sector 1 Sector 2 Flash Translation Layer (FTL) • Index Units vs. B-Tree Nodes

  21. Node: D F H I J I1 I2 I3 I4 I5 I6 I1 I2 I3 I4 I5 I6 Index Unit: 20 20 25 25 85 85 180 180 185 185 250 250 IndexUnit Sector: Sector 1 Sector 1 Sector 2 Sector 2 Flash Translation Layer (FTL) Efficient B-Tree Index Structures over Flash Memory • The Commit Policy Suppose that a sector can store up to 3 index units • The technical issue is to minimize the number of sectors written to store the committed index units. • The problem of packing index units into sectors that is reduced from the Bin-Packing problem is NP-Hard. • A FIRST-FIT approximation algorithm was adopted in our experiments.

  22. Efficient B-Tree Index Structures over Flash Memory • The Node Translation Table • To construct node C, BFTL reads and parses sectors whose addresses’ are 23 and 100 • To prevent the lists from being too long, the lists should be compacted when needed.

  23. Efficient B-Tree Index Structures over Flash Memory • Performance Evaluation • Experimental Setup • Flash-memory environments • A 4MB NAND flash memory. • The greedy block-recycling policy in garbage collection. • B-Tree environments • The fan-out of was 21. • The size of a B-Tree node fitted in a sector (512 bytes). • Other parameters • The reservation buffer was configured to hold up to 60 records. • The bound of the lengths of lists in the node translation table was set as 4.

  24. Efficient B-Tree Index Structures over Flash Memory • Experimental Results • Performance Metrics • Average response time. • Number of pages read and written. • Number of blocks erased. • Number of executions of the compact function

  25. Efficient B-Tree Index Structures over Flash Memory Average Response Time of Insertions after Inserting 30,000 Records Rs: To control the distribution of the values of the inserted keys. 1 Sequential 0 Random Rs

  26. Efficient B-Tree Index Structures over Flash Memory Number of Pages Written after Inserting 30,000 Records

  27. Efficient B-Tree Index Structures over Flash Memory Number of Pages Read after Inserting 30,000 Records

  28. Efficient B-Tree Index Structures over Flash Memory Number of Blocks Erased after Inserting 30,000 Records

  29. Efficient B-Tree Index Structures over Flash Memory Number of Executions of Compact Function after Inserting 30,000 Records

  30. Conclusion • Index structures usually cause intensively find-grained updates which could damage the performance and the reliability of flash memory. • An Efficient B-Tree implementation is proposed to resolve the confliction between page-based operations and intensive byte-wise updates. • Performance and reliability of flash memory could be greatly improved.

  31. Q & A Thank You Q & A

More Related