SlideShare a Scribd company logo
1 of 34
Write-Behind Logging
Course Instructor : Dr.Jahangard
Presented By : Pouyan Rezazadeh
2
HDDs
A durable storage device
Fast sequential access to data (block-oriented)
High capacity
Low price per GB
Write-Behind Logging
Slow for random access to data
3
SSDs
A durable storage device
Fast sequential access to data (block-oriented)
Up to 1000× faster than HDDs
Almost high capacity
Write-Behind Logging
oSlow for random access to data
oFixed number of times to be written to
o3-10× more expensive per GB vs HDDs
4
DRAMs
Fast access to fine-grained data (byte-level)
Up to 1000× faster than SSDs
Low capacity
Write-Behind Logging
oNon-Volatile
oMore expensive per GB vs HDDs
5
NVMs
A durable storage device
Fast access to fine-grained data (byte-level)
High capacity
Write-Behind Logging
oMore expensive per GB vs HDDs
6
NVM vs SSD & HDD
Synchronous writes to a large file (64 GB)
Synchronous write: Data is written in the order it is updated
Write-Behind Logging
7
How to use NVM in DBMS
How to use NVM in a DBMS running on a
hybrid storage hierarchy with both DRAM
and NVM?
Optimizing the storage methods for NVM
Improves both the DBMS performance and the
lifetime of the storage device
However, cannot be employed in a hybrid
storage hierarchy, as they target an NVM-only
system
Write-Behind Logging
8
How to use NVM in DBMS
Using NVM only for storing the log and
managing the database still on disk
A more cost-effective solution
Only leverages the low-latency sequential writes
of NVM
Does not exploit its ability to support random
writes and fine-grained data access
It is better to employ logging and recovery
algorithms that are designed for NVM
Write-Behind Logging
Write-Behind Logging
9
Write-Ahead Logging(WAL)
ARIES protocol, the most well-known recovery method based
on WAL
Our discussion is focused on disk-oriented DBMSs that use
the multi-version concurrency control (MVCC)
During normal operations, the DBMS records transactions’
modifications in a durable log before transferring data to
database in disk
To recover a database after a restart, the DBMS periodically
takes checkpoints at runtime
Write-Behind Logging
10
Write-Ahead Logging(WAL)
Write-Behind Logging
Log
Checkpoint
Table Heap
Volatile Storage
Durable Storage
11
Write-Ahead Logging(WAL)
The DBMS records the versioning metadata alongside the
tuple data
Determine whether a tuple version is visible to a transaction
When a transaction starts, the DBMS assigns it a unique
transaction identifier from a monotonically increasing global
counter
When a transaction commits, the DBMS assigns it a unique
commit timestamp by incrementing the timestamp of the last
committed transaction
Write-Behind Logging
12
Tuple Version Meta-data
Write-Behind Logging
Tuple ID Txn ID Begin CTS End CTS Prev V Data
101
102
103
-
-
-
1001
1001
1002
∞
∞
∞
-
-
101
Txn ID: The transaction identifier that currently holds a latch on the tuple
Begin CTS: The commit timestamp from which the tuple becomes visible
End CTS: The commit timestamp after which the tuple is not visible
Prev V: Reference to the previous version (if any) of the tuple
A tuple is visible to a transaction if and only if its last visible commit timestamp
falls within the BeginCTS and EndCTS fields of the tuple.
1002
305
302-
13
Structure of WAL Record
Write-Behind Logging
Checksum LSN
Log Record
Type
Transaction
Commit
Timestamp
Table Id
Insert
Location
Delete
Location
Before
Image
After Image
14
Dirty Page Table (DPT)
A disk-oriented DBMS maintains two meta-data tables at
runtime that it uses for recovery
Dirty page table (DPT) & Active transaction table (ATT)
DPT contains the modified pages that are in DRAM but have
not been propagated to durable storage
Each modified page has an entry in the DPT that marks the
log record’s LSN of the oldest transaction that modified it
To restore the page (Redo) during recovery
Write-Behind Logging
15
Active transaction table (ATT)
The second table tracks the status of the running transactions
This table records the LSN of the latest log record of all active
transactions
To undo the changes during recovery
Write-Behind Logging
16
WAL Recovery Protocol
Write-Behind Logging
Oldest Active
Transaction
Earliest Redo
Log Record
Checkpoint End of Log
Log (Time)
Analysis
Redo
Undo
During the redo phase, the DBMS skips replaying the log records
associated with uncommitted transactions.
17
Group Commit
Most DBMSs use group commit to minimize the I/O
overhead
It batches the log records for a group of transactions in a
buffer
Then flushes them together with a single write to durable
storage
Improves the transactional throughput
Write-Behind Logging
18
Disadvantage of WAL
Although WAL supports efficient transaction processing
when durable storage cannot support fast random writes, it is
inefficient for NVM storage
The DBMS first records the tuple’s contents in the log, and it
later propagates the change to the database
The logging algorithm can avoid this unnecessary data
duplication
Write-Behind Logging
19
Write-Behind Logging(WBL)
The changes made by transactions are guaranteed to be
already present on durable storage before they commit
The recovery algorithm can scan the entire database to
identify the dirty modifications
This is prohibitively expensive and increases the recovery
time
Tracking two commit timestamps in the log
Write-Behind Logging
20
Write-Behind Logging(WBL)
It records the timestamp of the latest committed transaction
whose changes and updates of prior transactions are safely
persisted on durable storage (𝑐 𝑝).
It records the commit timestamp that the DBMS promises to
not assign to any transaction before the next group commit
finishes (𝑐 𝑑, where 𝑐 𝑝 < 𝑐 𝑑).
When the DBMS restarts after a failure, it considers all the
transactions with commit timestamps earlier than 𝑐 𝑝 as
committed
Write-Behind Logging
21
Write-Behind Logging(WBL)
Ignores the changes of the transactions whose commit
timestamp is later than 𝑐 𝑝 and earlier than 𝑐 𝑑
In other words, if a tuple’s begin timestamp falls within the
(𝑐 𝑝, 𝑐 𝑑) pair
Then the DBMS’s transaction manager ensures that it is not
visible to any transaction that is executed after recovery
Write-Behind Logging
22
Structure of WBL Record
Write-Behind Logging
Checksum LSN Log Record Type
Persisted Commit
Timestamp( )
Dirty Commit
Timestamp( )
23
Write-Behind Logging(WBL)
Write-Behind Logging
Log
Table Heap
Volatile Storage
Durable Storage
Table Heap
24
Write-Behind Logging(WBL)
For long running transactions that span a group commit, the
DBMS also records their commit timestamps in the log
(𝑐 𝑝, 𝑐 𝑑) pair commit timestamp gap
The set of commit timestamp gaps that the DBMS needs to
track increases on every system failure
Write-Behind Logging
25
Write-Behind Logging(WBL)
To reduce overhead, the DBMS’s garbage collector thread
periodically scans the database
Garbage collector undoes the dirty modifications associated
with the currently present gaps
Once all the modifications in a gap have been removed by the
garbage collector
The DBMS stops checking for the gap in tuple visibility checks and
no longer records it in the log
Write-Behind Logging
26
WBL Commit Timestamp Gaps
Write-Behind Logging
Time
Group Commit
Gaps{ } {(101,199)} {(101,199)}
{(101,199),
(301,399)}
{ }
Garbage Collection
101 199
27
WBL Recovery Protocol
Write-Behind Logging
Checkpoint End of Log
Log (Time)
Analysis
28
WBL Recovery Protocol
Each WBL log record contains all the information needed for
recovery:
The list of commit timestamp gaps
The commit timestamps of long running transactions that span across
a group commit operation
The DBMS only needs to retrieve this information during the
analysis phase of the recovery process
Write-Behind Logging
29
Features of the System
Intel Lab’s hardware emulator that contains two Intel Xeon
E5-4620 CPUs (2.6 GHz)
Each with 8 cores and a 20 MB L3 cache
256 GB of DRAM
Dedicates 128 GB of DRAM for the emulated NVM
HDD: Seagate Barracuda (3 TB)
SSD: Intel DC S3700 (400 GB)
Write-Behind Logging
30
Evaluation
Write-Behind Logging
31
Evaluation
Write-Behind Logging
32
Evaluation
Write-Behind Logging
33
Evaluation
Write-Behind Logging
34
Write-Behind Logging

More Related Content

What's hot

HBase in Practice
HBase in PracticeHBase in Practice
HBase in Practicelarsgeorge
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
Lecture6 introduction to data streams
Lecture6 introduction to data streamsLecture6 introduction to data streams
Lecture6 introduction to data streamshktripathy
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlAbDul ThaYyal
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPTQUONTRASOLUTIONS
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating SystemKathirvel Ayyaswamy
 
Dremel: Interactive Analysis of Web-Scale Datasets
Dremel: Interactive Analysis of Web-Scale Datasets Dremel: Interactive Analysis of Web-Scale Datasets
Dremel: Interactive Analysis of Web-Scale Datasets robertlz
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemNaza hamed Jan
 
Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Akhil Nadh PC
 
Distributed document based system
Distributed document based systemDistributed document based system
Distributed document based systemChetan Selukar
 
Introduction to Presto at Treasure Data
Introduction to Presto at Treasure DataIntroduction to Presto at Treasure Data
Introduction to Presto at Treasure DataTaro L. Saito
 

What's hot (20)

Paging.ppt
Paging.pptPaging.ppt
Paging.ppt
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
HBase in Practice
HBase in PracticeHBase in Practice
HBase in Practice
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Lecture6 introduction to data streams
Lecture6 introduction to data streamsLecture6 introduction to data streams
Lecture6 introduction to data streams
 
Chapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency controlChapter 12 transactions and concurrency control
Chapter 12 transactions and concurrency control
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating System
 
Dremel: Interactive Analysis of Web-Scale Datasets
Dremel: Interactive Analysis of Web-Scale Datasets Dremel: Interactive Analysis of Web-Scale Datasets
Dremel: Interactive Analysis of Web-Scale Datasets
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Distributed document based system
Distributed document based systemDistributed document based system
Distributed document based system
 
Introduction to Presto at Treasure Data
Introduction to Presto at Treasure DataIntroduction to Presto at Treasure Data
Introduction to Presto at Treasure Data
 
GFS
GFSGFS
GFS
 

Similar to Write behind logging

Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4avniS
 
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...Виталий Стародубцев
 
LeanXcale Presentation - Waterloo University
LeanXcale Presentation - Waterloo UniversityLeanXcale Presentation - Waterloo University
LeanXcale Presentation - Waterloo UniversityRicardo Jimenez-Peris
 
Getting Started with Amazon Redshift - AWS July 2016 Webinar Series
Getting Started with Amazon Redshift - AWS July 2016 Webinar SeriesGetting Started with Amazon Redshift - AWS July 2016 Webinar Series
Getting Started with Amazon Redshift - AWS July 2016 Webinar SeriesAmazon Web Services
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency controlBinte fatima
 
A Front-Row Seat to Ticketmaster’s Use of MongoDB
A Front-Row Seat to Ticketmaster’s Use of MongoDBA Front-Row Seat to Ticketmaster’s Use of MongoDB
A Front-Row Seat to Ticketmaster’s Use of MongoDBMongoDB
 
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...Fwdays
 
Prelim Slides
Prelim SlidesPrelim Slides
Prelim Slidessmpant
 
Antonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration VariablesAntonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration VariablesAntonios Giannopoulos
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyRohit Dubey
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance AnalysisRodrigo Campos
 
Incremental backups
Incremental backupsIncremental backups
Incremental backupsVlad Lesin
 
515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptxssuser03ec3c
 

Similar to Write behind logging (20)

Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4
 
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
Технологии работы с дисковыми хранилищами и файловыми системами Windows Serve...
 
CockroachDB
CockroachDBCockroachDB
CockroachDB
 
LeanXcale Presentation - Waterloo University
LeanXcale Presentation - Waterloo UniversityLeanXcale Presentation - Waterloo University
LeanXcale Presentation - Waterloo University
 
Getting Started with Amazon Redshift - AWS July 2016 Webinar Series
Getting Started with Amazon Redshift - AWS July 2016 Webinar SeriesGetting Started with Amazon Redshift - AWS July 2016 Webinar Series
Getting Started with Amazon Redshift - AWS July 2016 Webinar Series
 
Transactional Memory
Transactional MemoryTransactional Memory
Transactional Memory
 
Aries
AriesAries
Aries
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
Accordion - VLDB 2014
Accordion - VLDB 2014Accordion - VLDB 2014
Accordion - VLDB 2014
 
A Front-Row Seat to Ticketmaster’s Use of MongoDB
A Front-Row Seat to Ticketmaster’s Use of MongoDBA Front-Row Seat to Ticketmaster’s Use of MongoDB
A Front-Row Seat to Ticketmaster’s Use of MongoDB
 
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
Dmytro Okhonko "LogDevice: durable and highly available sequential distribute...
 
Prelim Slides
Prelim SlidesPrelim Slides
Prelim Slides
 
Dba tuning
Dba tuningDba tuning
Dba tuning
 
Antonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration VariablesAntonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
Antonios Giannopoulos Percona 2016 WiredTiger Configuration Variables
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubey
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
z/VM Performance Analysis
z/VM Performance Analysisz/VM Performance Analysis
z/VM Performance Analysis
 
Postgres clusters
Postgres clustersPostgres clusters
Postgres clusters
 
Incremental backups
Incremental backupsIncremental backups
Incremental backups
 
515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx515689311-Postgresql-DBA-Architecture.pptx
515689311-Postgresql-DBA-Architecture.pptx
 

Recently uploaded

➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...amitlee9823
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...gajnagarg
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...amitlee9823
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachBoston Institute of Analytics
 

Recently uploaded (20)

➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men  🔝Ongole🔝   Escorts S...
➥🔝 7737669865 🔝▻ Ongole Call-girls in Women Seeking Men 🔝Ongole🔝 Escorts S...
 
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
Just Call Vip call girls Erode Escorts ☎️9352988975 Two shot with one girl (E...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Rabindra Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Rabindra Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 

Write behind logging

  • 1. Write-Behind Logging Course Instructor : Dr.Jahangard Presented By : Pouyan Rezazadeh
  • 2. 2 HDDs A durable storage device Fast sequential access to data (block-oriented) High capacity Low price per GB Write-Behind Logging Slow for random access to data
  • 3. 3 SSDs A durable storage device Fast sequential access to data (block-oriented) Up to 1000× faster than HDDs Almost high capacity Write-Behind Logging oSlow for random access to data oFixed number of times to be written to o3-10× more expensive per GB vs HDDs
  • 4. 4 DRAMs Fast access to fine-grained data (byte-level) Up to 1000× faster than SSDs Low capacity Write-Behind Logging oNon-Volatile oMore expensive per GB vs HDDs
  • 5. 5 NVMs A durable storage device Fast access to fine-grained data (byte-level) High capacity Write-Behind Logging oMore expensive per GB vs HDDs
  • 6. 6 NVM vs SSD & HDD Synchronous writes to a large file (64 GB) Synchronous write: Data is written in the order it is updated Write-Behind Logging
  • 7. 7 How to use NVM in DBMS How to use NVM in a DBMS running on a hybrid storage hierarchy with both DRAM and NVM? Optimizing the storage methods for NVM Improves both the DBMS performance and the lifetime of the storage device However, cannot be employed in a hybrid storage hierarchy, as they target an NVM-only system Write-Behind Logging
  • 8. 8 How to use NVM in DBMS Using NVM only for storing the log and managing the database still on disk A more cost-effective solution Only leverages the low-latency sequential writes of NVM Does not exploit its ability to support random writes and fine-grained data access It is better to employ logging and recovery algorithms that are designed for NVM Write-Behind Logging Write-Behind Logging
  • 9. 9 Write-Ahead Logging(WAL) ARIES protocol, the most well-known recovery method based on WAL Our discussion is focused on disk-oriented DBMSs that use the multi-version concurrency control (MVCC) During normal operations, the DBMS records transactions’ modifications in a durable log before transferring data to database in disk To recover a database after a restart, the DBMS periodically takes checkpoints at runtime Write-Behind Logging
  • 11. 11 Write-Ahead Logging(WAL) The DBMS records the versioning metadata alongside the tuple data Determine whether a tuple version is visible to a transaction When a transaction starts, the DBMS assigns it a unique transaction identifier from a monotonically increasing global counter When a transaction commits, the DBMS assigns it a unique commit timestamp by incrementing the timestamp of the last committed transaction Write-Behind Logging
  • 12. 12 Tuple Version Meta-data Write-Behind Logging Tuple ID Txn ID Begin CTS End CTS Prev V Data 101 102 103 - - - 1001 1001 1002 ∞ ∞ ∞ - - 101 Txn ID: The transaction identifier that currently holds a latch on the tuple Begin CTS: The commit timestamp from which the tuple becomes visible End CTS: The commit timestamp after which the tuple is not visible Prev V: Reference to the previous version (if any) of the tuple A tuple is visible to a transaction if and only if its last visible commit timestamp falls within the BeginCTS and EndCTS fields of the tuple. 1002 305 302-
  • 13. 13 Structure of WAL Record Write-Behind Logging Checksum LSN Log Record Type Transaction Commit Timestamp Table Id Insert Location Delete Location Before Image After Image
  • 14. 14 Dirty Page Table (DPT) A disk-oriented DBMS maintains two meta-data tables at runtime that it uses for recovery Dirty page table (DPT) & Active transaction table (ATT) DPT contains the modified pages that are in DRAM but have not been propagated to durable storage Each modified page has an entry in the DPT that marks the log record’s LSN of the oldest transaction that modified it To restore the page (Redo) during recovery Write-Behind Logging
  • 15. 15 Active transaction table (ATT) The second table tracks the status of the running transactions This table records the LSN of the latest log record of all active transactions To undo the changes during recovery Write-Behind Logging
  • 16. 16 WAL Recovery Protocol Write-Behind Logging Oldest Active Transaction Earliest Redo Log Record Checkpoint End of Log Log (Time) Analysis Redo Undo During the redo phase, the DBMS skips replaying the log records associated with uncommitted transactions.
  • 17. 17 Group Commit Most DBMSs use group commit to minimize the I/O overhead It batches the log records for a group of transactions in a buffer Then flushes them together with a single write to durable storage Improves the transactional throughput Write-Behind Logging
  • 18. 18 Disadvantage of WAL Although WAL supports efficient transaction processing when durable storage cannot support fast random writes, it is inefficient for NVM storage The DBMS first records the tuple’s contents in the log, and it later propagates the change to the database The logging algorithm can avoid this unnecessary data duplication Write-Behind Logging
  • 19. 19 Write-Behind Logging(WBL) The changes made by transactions are guaranteed to be already present on durable storage before they commit The recovery algorithm can scan the entire database to identify the dirty modifications This is prohibitively expensive and increases the recovery time Tracking two commit timestamps in the log Write-Behind Logging
  • 20. 20 Write-Behind Logging(WBL) It records the timestamp of the latest committed transaction whose changes and updates of prior transactions are safely persisted on durable storage (𝑐 𝑝). It records the commit timestamp that the DBMS promises to not assign to any transaction before the next group commit finishes (𝑐 𝑑, where 𝑐 𝑝 < 𝑐 𝑑). When the DBMS restarts after a failure, it considers all the transactions with commit timestamps earlier than 𝑐 𝑝 as committed Write-Behind Logging
  • 21. 21 Write-Behind Logging(WBL) Ignores the changes of the transactions whose commit timestamp is later than 𝑐 𝑝 and earlier than 𝑐 𝑑 In other words, if a tuple’s begin timestamp falls within the (𝑐 𝑝, 𝑐 𝑑) pair Then the DBMS’s transaction manager ensures that it is not visible to any transaction that is executed after recovery Write-Behind Logging
  • 22. 22 Structure of WBL Record Write-Behind Logging Checksum LSN Log Record Type Persisted Commit Timestamp( ) Dirty Commit Timestamp( )
  • 23. 23 Write-Behind Logging(WBL) Write-Behind Logging Log Table Heap Volatile Storage Durable Storage Table Heap
  • 24. 24 Write-Behind Logging(WBL) For long running transactions that span a group commit, the DBMS also records their commit timestamps in the log (𝑐 𝑝, 𝑐 𝑑) pair commit timestamp gap The set of commit timestamp gaps that the DBMS needs to track increases on every system failure Write-Behind Logging
  • 25. 25 Write-Behind Logging(WBL) To reduce overhead, the DBMS’s garbage collector thread periodically scans the database Garbage collector undoes the dirty modifications associated with the currently present gaps Once all the modifications in a gap have been removed by the garbage collector The DBMS stops checking for the gap in tuple visibility checks and no longer records it in the log Write-Behind Logging
  • 26. 26 WBL Commit Timestamp Gaps Write-Behind Logging Time Group Commit Gaps{ } {(101,199)} {(101,199)} {(101,199), (301,399)} { } Garbage Collection 101 199
  • 27. 27 WBL Recovery Protocol Write-Behind Logging Checkpoint End of Log Log (Time) Analysis
  • 28. 28 WBL Recovery Protocol Each WBL log record contains all the information needed for recovery: The list of commit timestamp gaps The commit timestamps of long running transactions that span across a group commit operation The DBMS only needs to retrieve this information during the analysis phase of the recovery process Write-Behind Logging
  • 29. 29 Features of the System Intel Lab’s hardware emulator that contains two Intel Xeon E5-4620 CPUs (2.6 GHz) Each with 8 cores and a 20 MB L3 cache 256 GB of DRAM Dedicates 128 GB of DRAM for the emulated NVM HDD: Seagate Barracuda (3 TB) SSD: Intel DC S3700 (400 GB) Write-Behind Logging