0

How to make a real-time copy of the database to another disk?

My database is very small, but WAL-logs are very large (many changes in time). I don't need 'Point-in-Time Recovery', I just need the latest version of the database. How to force a sql server to maintain an additional copy of the database to another disk in case the first disk lost data (hardware failure)?

asked Jun 17, 2019 at 12:54
5
  • Question seems to be about SQL Server. Question is tagged PostgreSQL. Which one are you really using? Commented Jun 17, 2019 at 13:27
  • Postgresql in title. Postgresql is also sql server. Commented Jun 17, 2019 at 14:38
  • 1
    "Postgresql is also sql server" is not idiomatic English. "PostgreSQL is also a SQL server" is idiomatic. The meanings are quite different. Commented Jun 17, 2019 at 14:48
  • Ok, sorry for may poor english. Commented Jun 17, 2019 at 15:04
  • No need to apologize. Idiomatic English is hard. Commented Jun 17, 2019 at 15:07

1 Answer 1

1

If the first database "loses data", it's liable to tell the second database to "lose data to match me". (Depends on exactly what you mean by "lose data".) So reduce the chances of your database losing data due to a single disk failure by storing the database on an array: RAID 1, RAID 5, RAID 6, or RAID 10. I recommend RAID 6.

It's not clear whether you've read the docs for PostgreSQL's High Availability, Load Balancing, and Replication. Streaming replication is probably worth looking at.

To mitigate the risk of "losing data", you need to be precise about losing data means. Mitigating the risk of disk failure is different than mitigating the risk of an application deleting data by accident.

answered Jun 17, 2019 at 15:00
2
  • Yes, I read this. As far as I understand, replication is only possible between a few servers. I have a local machine with one server. Commented Jun 17, 2019 at 15:13
  • I'm just worried about risk of disk failure. Commented Jun 17, 2019 at 15:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.