From the course: Advanced SQL for Application Development

Unlock the full course today

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

Using read-only replicas

Using read-only replicas

From the course: Advanced SQL for Application Development

Start my 1-month free trial

Using read-only replicas

- [Narrator] Now another thing we can do to improve our I/O performance is to use something called read-only replicas. Basically, the idea is that reading and writing to the same database disks, or SSDs, can create contention. So there's only so much I/O a particular device can handle. And this is particularly problematic when writing data to the database, because we want to be able to have certain levels of consistency and transaction control. When we write data, the database typically locks the rows. And that means only one process can write to those rows at a time. Now reading does not need to lock rows. So we can take advantage of this to make copies of the data. And when we use something called replicas, what we're doing is keeping separate copies of the data, but in a single database. So we have our primary and our replica. And each of these are datasets. And what we can do is always write to the primary. And when we…

Contents