Optimistic replication

Optimistic replication, also known as lazy replication,[1][2] is a strategy for replication, in which replicas are allowed to diverge.[3]

Traditional pessimistic replication systems try to guarantee from the beginning that all of the replicas are identical to each other, as if there was only a single copy of the data all along. Optimistic replication does away with this in favor of eventual consistency, meaning that replicas are guaranteed to converge only when the system has been quiesced for a period of time. As a result, there is no longer a need to wait for all of the copies to be synchronized when updating data, which helps concurrency and parallelism. The trade-off is that different replicas may require explicit reconciliation later on, which might then prove difficult or even insoluble.

Algorithms

An optimistic replication algorithm consists of five elements:

  1. Operation submission: Users submit operations at independent sites.
  2. Propagation: Each site shares the operations it knows about with the rest of the system.
  3. Scheduling: Each site decides on an order for the operations it knows about.
  4. Conflict resolution: If there are any conflicts among the operations a site has scheduled, it must modify them in some way.
  5. Commitment: The sites agree on a final schedule and conflict resolution result, and the operations are made permanent.

There are two strategies for propagation: state transfer, where sites propagate a representation of the current state, and operation transfer, where sites propagate the operations that were performed (essentially, a list of instructions on how to reach the new state).

Scheduling and conflict resolution can either be syntactic or semantic. Syntactic systems rely on general information, such as when or where an operation was submitted. Semantic systems are able to make use of application-specific information to make smarter decisions. Note that state transfer systems generally have no information about the semantics of the data being transferred, and so they have to use syntactic scheduling and conflict resolution.

Examples

One well-known example of a system based on optimistic replication is the CVS version control system, or any other version control system which uses the copy-modify-merge paradigm. CVS covers each of the five elements:

  1. Operation submission: Users edit local versions of files.
  2. Propagation: Users manually pull updates from a central server, or push changes out once the user feels they are ready.
  3. Scheduling: Operations are scheduled in the order that they are received by the central server.
  4. Conflict resolution: When a user pushes to or pulls from the central repository, any conflicts will be flagged for that user to fix manually.
  5. Commitment: Once the central server accepts the changes which a user pushes, they are permanently committed.

A special case of replication is synchronization, where there are only two replicas. For example, personal digital assistants (PDAs) allow users to edit data either on the PDA or a computer, and then to merge these two datasets together. Note, however, that replication is a broader problem than synchronization, since there may be more than two replicas.

Other examples include:

Implications

Applications built on top of optimistic replicated databases need to be careful about ensuring that the delayed updates observed do not impair the correctness of the application.

As a simple example, if an application contains a way of viewing some part of the database state, and a way of editing it, then users may edit that state but then not see it changing in the viewer. Alarmed that their edit "didn't work", they may try it again, potentially more than once. If the updates are not idempotent (e.g., they increment a value), this can lead to disaster. Even if they are idempotent, the spurious database updates can lead to performance bottlenecks, especially when the database systems are processing heavy loads; this can become a vicious circle.

Testing of applications is often done on a testing environment, smaller in size (perhaps only a single server) and less loaded than the "live" environment. The replication behaviour of such an installation may differ from a live environment in ways that mean that replication lag is unlikely to be observed in testing, masking replication-sensitive bugs. Application developers must be very careful about the assumptions they make about the effect of a database update, and must be sure to simulate lag in their testing environments.

Optimistically replicated databases have to be very careful about offering features such as validity constraints on data. If any given update may or may not be accepted based on the current state of the record, then two updates (A and B) may be individually legal against the starting state of the system, but one or more of the updates may not be legal against the state of the system after the other update (e.g., A and B are both legal, but AB or BA are illegal). If A and B are both initiated at roughly the same time within the database, then A may be successfully applied on some nodes and B on others, but as soon as A and B "meet" and one is attempted on a node which has already applied the other, a conflict will be found. The system must, in this case, decide which update finally "wins", and arrange for any nodes that have already applied the losing update to revert it. However, some nodes may temporarily expose the state with the reverted update, and there may be no way to inform the user who initiated the update of its failure, without requiring them to wait (potentially forever) for confirmation of acceptance at every node.

References

  1. ^ Ladin, R.; Liskov, B.; Shrira, L.; Ghemawat, S. (1992). "Providing high availability using lazy replication". ACM Transactions on Computer Systems. 10 (4): 360–391. CiteSeerX 10.1.1.586.7749. doi:10.1145/138873.138877. S2CID 2219840.
  2. ^ Ladin, R.; Liskov, B.; Shrira, L. (1990). Lazy replication: exploiting the semantics of distributed services. Proceedings of the Ninth Annual ACM Symposium on Principles of Distributed Computing. pp. 43–57. doi:10.1145/93385.93399. hdl:1721.1/149694.
  3. ^ Saito, Yasushi; Shapiro, Marc (2005). "Optimistic replication". ACM Computing Surveys. 37 (1): 42–81. CiteSeerX 10.1.1.324.3599. doi:10.1145/1057977.1057980. S2CID 1503367.
  4. ^ Gray, J.; Helland, P.; O’Neil, P.; Shasha, D. (1996). The dangers of replication and a solution (PDF). Proceedings of the 1996 ACM SIGMOD International Conference on Management of Data. pp. 173–182. doi:10.1145/233269.233330.[permanent dead link]
  5. ^ Terry, D.B.; Theimer, M.M.; Petersen, K.; Demers, A.J.; Spreitzer, M.J.; Hauser, C.H. (1995). Managing update conflicts in Bayou, a weakly connected replicated storage system. Proceedings of the Fifteenth ACM Symposium on Operating Systems Principles. pp. 172–182. doi:10.1145/224056.224070.
  6. ^ Kermarrec, A.M.; Rowstron, A.; Shapiro, M.; Druschel, P. (2001). The IceCube approach to the reconciliation of divergent replicas. Proceedings of the Twentieth Annual ACM Symposium on Principles of Distributed Computing. pp. 210–218. doi:10.1145/383962.384020.

Read other articles:

Gerbang Kuil Fawang Pagoda Kuil Fawang Kuil Fawang (Hanzi: 法王寺) adalah kuil Buddha Tiongkok yang terletak 5 km (3,1 mi) di barat laut kota Dengfeng, Provinsi Henan, Tiongkok. Kuil ini berada di kaki Puncak Yuzhu, salah satu puncak yang ada di Gunung Song. Kuil Fawang memiliki Pagoda Tiongkok yang dibangun selama Dinasti Tang (618–907). Pagoda ini merupakan pagoda yang paling menonjol di awal era Tang, menaranya berbentuk persegi terbuat dari batu setinggi 40 m (...

 

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Oktober 2020. Carl Johan HviidLahir(1899-06-27)27 Juni 1899Frederiksberg, DenmarkMeninggal21 Oktober 1964(1964-10-21) (umur 65)Roskilde, DenmarkPekerjaanPemeranTahun aktif1939–1964 Carl Johan Hviid (27 Juni 1899 – 21 Oktober 1964) adalah ...

 

Gibilterra (dettagli) (dettagli) Motto: (LA) Nulli Expugnabilis Hosti(IT) Non espugnabile da alcun nemico Gibilterra - Localizzazione Dati amministrativi Nome completo Gibilterra Nome ufficiale Gibraltar Dipendente da  Regno Unito Lingue ufficiali inglese Altre lingue Spagnolo, llanito Politica Status Territorio d'oltremare Re Carlo IIIGovernatore:Sir David Steel Primo ministro Fabian Picardo Superficie Totale 6,8 km² % delle acque 0 % Popolazione Totale 34.003 ab. (2020) Den...

Gambar sampul volume pertama versi DVD untuk Bakuman musim pertama. Seri anime Bakuman didasarkan dari seri manga berjudul sama, yang ditulis oleh Tsugumi Ohba dan diilustrasikan oleh Takeshi Obata. Seri anime ini disutradarai oleh Ken'ichi Kasai, dianimasikan oleh J.C.Staff, serta diproduksi oleh NHK.[1] Ceritanya mengisahkan tentang kehidupan Moritaka Mashiro dan Akito Takagi yang mencoba untuk membuat manga yang populer agar bisa diadaptasi menjadi anime. Musim pertamanya yang terd...

 

Cet article est une ébauche concernant le Ghana. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Pour les articles homonymes, voir Ga. District municipal de Ga est Les districts de la région du Grand Accra Administration Pays Ghana Région Région du Grand Accra Catégorie de District Ordinaire Capitale Abokobi Gouverneur John Kwao Sackey Démographie Population 345 154 hab. (2004) Densité 3 05...

 

Species of mammal Spotted seal In Echizen Matsushima Aquarium, Japan Conservation status Least Concern  (IUCN 3.1)[1] Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Chordata Class: Mammalia Order: Carnivora Clade: Pinnipedia Family: Phocidae Genus: Phoca Species: P. largha Binomial name Phoca larghaPallas, 1811 Spotted seal distribution The spotted seal (Phoca largha),[2] also known as the larga seal or largha seal, is a member of the family Ph...

Katedral St. Jago de la Vega Spanish Town merupakan sebuah kota di Jamaika. Kota ini letaknya di bagian selatan. Tepatnya di Parish Saint Catherine. Pada tahun 2010, kota ini memiliki jumlah penduduk sebesar 162.359 jiwa. Kota ini merupakan kota terbesar ketiga di Jamaika. Sumber lain James Robertson, Gone is the Ancient Glory, Spanish Town Jamaica 1534-2000, Kingston, Jamaica: 2005. Parish Information Diarsipkan 2008-12-04 di Wayback Machine. Artikel bertopik geografi ini adalah sebuah rinti...

 

هذه المقالة عن ويلينغتون (تكساس). لتصفح عناوين مشابهة، انظر ويلينغتون (توضيح). ويلينغتون     الإحداثيات 34°51′17″N 100°12′50″W / 34.8547°N 100.214°W / 34.8547; -100.214   [1] تقسيم إداري  البلد الولايات المتحدة[2][3]  التقسيم الأعلى مقاطعة كولينغزوورث  عاصمة ل...

 

Soyuz TMA-15M adalah penerbangan 2.014 ke Stasiun Antariksa Internasional. Hal diangkut tiga awak anggota Ekspedisi 42 ke Stasiun Antariksa Internasional. TMA-15M adalah penerbangan 124 dari pesawat ruang angkasa Soyuz, peluncuran penerbangan pertama pada tahun 1967. Referensi Планируемые полёты (in Russian). astronaut.ru. Retrieved 30 June 2012. astronaut.ru (2013). Орбитальные полёты. Clark, Stephen. Live coverage: US-Russian-Italian crew set for Soyuz lau...

Частина серії проФілософіяLeft to right: Plato, Kant, Nietzsche, Buddha, Confucius, AverroesПлатонКантНіцшеБуддаКонфуційАверроес Філософи Епістемологи Естетики Етики Логіки Метафізики Соціально-політичні філософи Традиції Аналітична Арістотелівська Африканська Близькосхідна іранська Буддій�...

 

Эта статья описывает находящуюся в разработке компьютерную игру.После выпуска игры сведения, приведённые здесь, могут оказаться неверными, и содержание статьи может значительно измениться. Star Wars Eclipse Разработчик Quantic Dream Издатель Lucasfilm Games Часть серии игра по вселенно�...

 

Disambiguazione – Se stai cercando altri significati, vedi Tarquinia (disambigua). Tarquiniacomune Tarquinia – Veduta LocalizzazioneStato Italia Regione Lazio Provincia Viterbo AmministrazioneSindacoAlessandro Giulivi (Lega per Salvini Premier e liste civiche di centro-destra) dal 9-6-2019 TerritorioCoordinate42°14′57″N 11°45′22″E42°14′57″N, 11°45′22″E (Tarquinia) Altitudine133 m s.l.m. Superficie279,34 km² Abitanti15 966 ...

Cabinet of Radoman Božović2nd Cabinet of Republic of Serbia1991–1993Date formed23 December 1991Date dissolved10 February 1993People and organisationsHead of stateSlobodan MiloševićHead of governmentRadoman BožovićMember partiesSPSHistoryElection9–23 December 1990PredecessorCabinet of Dragutin ZelenovićSuccessorCabinet of Nikola Šainović Cabinet of Radoman Božović was sworn in on 23 December 1991, after the previous cabinet under Dragutin Zelenović resigned due to economic fail...

 

Expressway in China This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: G11 Hegang–Dalian Expressway – news · newspapers · books · scholar · JSTOR (August 2021) (Learn how and when to remove this message) Hegang–Dalian Expressway鹤岗-大连高速公路Heda Expressway鹤大高速公路Route informationLen...

 

Retrato de Baldomero Sanmartín y Arnal Baldomero de San Martín Arnal[a]​ (Madrid, 1845-Badalona, 1931)[3]​ fue un político español de tendencia republicana, alcalde de Ciudad Real en 1873 y de Badalona en 1930.[4]​ Biografía Nació en Madrid el 25 de febrero de 1845,[2]​ donde se licenció en Ciencias Naturales.[3]​[1]​ Establecido en Ciudad Real, se unió al Partido Republicano Federal y alcanzó la alcaldía de la ciudad en 1873, durante la Primera R...

مخطط توضيحي لنظام ثنائي مع كوكبين من نوع-S ومن نوع-P. تعتبر الكواكب الموجودة في أنظمة نجمية ثنائية مرشحة لإحتواء الحياة الفضائية،[1] توجد العديد من العوامل مختلفة المصادر لتحديد قابلية الكوكب على السكن في الأنظمة الثنائية،[2] حيث يقدر مبدئياً أن حوالي نصف النجوم أو أ�...

 

ダンシング・ポールベアラーズDancing Pallbearers 2016年3月撮影基本情報出身地 ガーナグレーター・アクラ州プラムプラムメンバー Benjamin Aidoo ダンシング・ポールベアラーズ(Dancing Pallbearers、踊る棺担ぎ人)は、ガーナ南部・グレーター・アクラ州のプラムプラムという海岸沿いの町に拠点を置く棺担ぎ人(英語版)のグループの通称である[1][2][3][4]...

 

Nyi Pandan Sari adalah sosok legendaris dalam cerita rakyat Jawa yang dikenal sebagai perempuan cantik, bijaksana, dan memiliki keterkaitan dengan kekuatan spiritual serta alam. Ia kerap muncul dalam mitos masyarakat Jawa sebagai penjaga tempat suci atau sebagai pelindung daerah-daerah tertentu. Meskipun tidak ada bukti sejarah yang mendukung keberadaannya, Nyi Pandan Sari dihormati sebagai simbol keindahan, kekuatan perempuan, dan penjaga harmoni antara manusia dan alam.[1][2]...

Questa voce sull'argomento arbitri di calcio è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Franz WöhrerInformazioni personaliArbitro di Calcio Federazione Austria ProfessioneInsegnante Attività nazionale AnniCampionatoRuolo 1957-1987BundesligaArbitro Attività internazionale AnniConfederazioneRuolo 1969-1987UEFA e FIFAArbitro Franz Wöhrer (5 giugno 1939) è un ex arbitro di calcio austriaco. Carriera Wöhrer esordisce come arbitro nella Bund...

 

County in Sudogwon, South KoreaGanghwa County 강화군CountyKorean transcription(s) • Hanja江華郡 • Revised RomanizationGanghwa-gun • McCune-ReischauerKanghwa-kun FlagCountrySouth KoreaRegionSudogwonProvincial levelIncheonAdministrative divisions1 eup, 13 myeon, 96 riArea • Total411.4 km2 (158.8 sq mi)Population (2020) • Total69,154 • Density170/km2 (440/sq mi) • DialectSeoulW...