- Mastering PostgreSQL 9.6
- Hans Jurgen Schonig
- 233字
- 2021-07-09 19:57:10
Using multiple synchronous standby servers
PostgreSQL has been able to perform synchronous replication for quite a while already. In PostgreSQL, it is possible to have more than just one synchronous server from 9.6 onward. Earlier, only one server had to acknowledge a commit. Now it is possible to have an entire group of servers that has to confirm a commit. This is especially important if you want to improve reliability in case of multi-node error.
The syntax to use this new feature is simple:
synchronous_standby_names = '3 (server1, server2, server3, server4)
However, there is more to synchronous replication in PostgreSQL 9.6. Previously, PostgreSQL ensured (synchronous_commit = on) that the transaction log has reached the slave. However, this did not mean that data was actually visible. Consider an example: somebody adds a user to the master, instantly connects to the slave, and checks for the user. While the transaction log was guaranteed to be on the slave, it was not necessarily guaranteed that the data inside the log was already visible to the end user (due to replication conflicts and so on). By setting synchronous_commit = 'remote_apply', it is now possible to query the slave directly after a commit on the master, without having to worry that data might not be visible yet. The remote_apply value is slower than the on value but it allows to write more advanced applications.
- 平面設(shè)計(jì)初步
- Practical Ansible 2
- Mobile DevOps
- 群體智能與數(shù)據(jù)挖掘
- 大數(shù)據(jù)平臺(tái)異常檢測(cè)分析系統(tǒng)的若干關(guān)鍵技術(shù)研究
- 具比例時(shí)滯遞歸神經(jīng)網(wǎng)絡(luò)的穩(wěn)定性及其仿真與應(yīng)用
- 信息物理系統(tǒng)(CPS)測(cè)試與評(píng)價(jià)技術(shù)
- Ruby on Rails敏捷開發(fā)最佳實(shí)踐
- 云原生架構(gòu)進(jìn)階實(shí)戰(zhàn)
- PostgreSQL 10 Administration Cookbook
- 手機(jī)游戲策劃設(shè)計(jì)
- MATLAB-Simulink系統(tǒng)仿真超級(jí)學(xué)習(xí)手冊(cè)
- 工業(yè)機(jī)器人實(shí)操進(jìn)階手冊(cè)
- PowerMill 2020五軸數(shù)控加工編程應(yīng)用實(shí)例
- 計(jì)算機(jī)組裝與維修實(shí)訓(xùn)