370 likes | 558 Views
Logging in Flash-based Database Systems. Lu Zeping 2009-06-27. Outline . Characteristics of flash memory Log records in different kinds of Flash devices In Flash chips - IPL In SSD In USB – FlashLogging Future work Recovery processing Experiments of PTLog. Outline .
E N D
Logging in Flash-based Database Systems Lu Zeping 2009-06-27
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
Characteristics of flash memory • No in-place update × Out – place update
Characteristics of flash memory • No mechanical latency
Characteristics of flash memory • Asymmetric speed of read/write
The flash memory organization Device : 1G Block : 1024 Page : 64 2K Bytes 64 Bytes Page Register
The flash memory organization Device : 1G Block : 1024 Page : 64 2K Bytes 64 Bytes Page Register
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
Design of IPL • IPL:In-Page Logging in-memory data page (8KB) Database Buffer in-memory log sector (512B) S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
Design of IPL 15 data pages (8KB each) Erase unit (Block): 128KB Flash Memory …… log area (8KB): 16 sectors …… …. …. …. S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
IPL Write in-memory data page (8KB) Database Buffer in-memory log sector (512B) Erase unit (Block): 128KB Flash Memory 15 data pages (8KB each) …… log area (8KB): 16 sectors …… …. …. …. S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
IPL Read in-memory data page (8KB) Database Buffer in-memory log sector (512B) Erase unit (Block): 128KB Flash Memory 15 data pages (8KB each) …… log area (8KB): 16 sectors …… …. …. …. S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
IPL Read in-memory data page (8KB) Database Buffer in-memory log sector (512B) Erase unit (Block): 128KB Flash Memory 15 data pages (8KB each) …… log area (8KB): 16 sectors …… …. …. …. S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
IPL Merge Merge Flash Memory …… …… …. …. …… …… …. …. …. …. …. …. S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
IPL Merge Merge Flash Memory …… …… …. …. …… …… …. …. …. …. …. …. S. W. Lee, and B. Moon. Design of Flash-Based DBMS: An In-Page Logging Approach. SIGMOD 2007
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
SSD • SSD = Flash memory + FTL(Flash Translation Layer)
To be used in…… • Accessing data in secondary storage is the main source of bottlenecks in database processing. • Database table, index, log, temporary table and rollback segment could be created on physically separate storage devices .(SSD+ HDD) • Log records are always appended to the end of log.
TPC-B benchmark performance We used TPC-B to stress-test the log storage part of the commercial database server. Due to the group commit mechanism, the average size of a single log write was slightly different between the two storage media. B. Moon, C. Park, S. W. Lee. A Case for Flash Memory SSD in Enterprise Database Applications. SIGMOD 2008.
TPC-B benchmark performance In the case of SSD, the bottleneck in transaction throughput is the processing speed of CPU , while it was not in the case of disk. B. Moon, C. Park, S. W. Lee. A Case for Flash Memory SSD in Enterprise Database Applications. SIGMOD 2008.
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
USB flash memory advantages • USB ports are widely available. • USB bus bandwidth is good for logging. • The hot-plug capability allows easy replacement of drives. • The price of an individual drive is low. Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Flash devices and disk performance Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Four key challenges • Efficiently exploiting an array of flash drives. • Coping with large variance of write latencies. • Efficient recovery processing. • Combining USB flash drives with disks for better logging and recovery performance. Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Exploiting an array of flash drives What’s wrong with the conventional array organization? …… Devices:N In-memory log buffer the stripe unit size is S Data at address A are found on the k-th device, where k = ⌊A/S⌋ mod N. Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Unconventional array design …… Worker Worker Worker Request queue In-memory log buffer LSN:Log Sequence Number Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Coping with outlier Writes • Sequential writes have large variance • Outlier prediction is difficult. Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Outlier Detection and Hiding Measure the average sequential write latencies for different request sizes for a device. Outlier hiding area Non-decreasing LSN? Worker Worker Reissue the same request to a different ready device. Longer than twice the average latency? In-memory log buffer
Efficient recovery processing Two main steps of recovery processing • Locating the log record corresponding to the LSN in the last checkpoint. (ii) Scanning the log sequentially until the crash point. Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Flash devices and disk performance Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
FlashLogging design …… Worker Worker Worker Request queue In-memory log buffer Shimin Chen. FlashLogging: Exploiting Flash Devices for Synchronous Logging Performance. SIGMOD'09.
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
Outline • Characteristics of flash memory • Log records in different kinds of Flash devices • In Flash chips - IPL • In SSD • In USB – FlashLogging • Future work • Recovery processing • Experiments of PTLog
Experiments of PTLog • Berkeley DB • LinuxNandsim nand_base.c、 nand_bbt.c、nand_ids.c、 nand_ecc.c 、 nandsim.c 、diskonchip.c、cafe_nand.c 、s3c2410.c
Thank you! Q&A?