From the course: Designing Highly Scalable and Highly Available SQL Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding write-ahead logging

Understanding write-ahead logging

From the course: Designing Highly Scalable and Highly Available SQL Databases

Start my 1-month free trial

Understanding write-ahead logging

- [Instructor] When it comes to implementing read replication, the PostgreSQL database uses a really interesting idea, which is to take advantage of the transaction logs that are there for durability and atomicity. So we're going to look at something known as the write-ahead log or the WAL file. Now, a write-ahead log is append-only mechanism and really, this was developed to enable the sort of acid transactions. We want to be able to have atomic changes to the database and we want our data to be durable. So it's used for both of those things. But in addition, it can also be used as a source of data for creating read replicas. So let's think about a simple write operation to the database. So we have a client application. Maybe it's going to update a record. There's a new sales on a website, so it's writing some data to the primary. So that data gets sent from the client where the application is running and it's…

Contents