Digitala Vetenskapliga Arkivet

Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Assessing the Feasibility of the Expand-Contract Pattern in Master-Master Replication Environments
KTH, School of Electrical Engineering and Computer Science (EECS).
2024 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE creditsStudent thesisAlternative title
Utvärdering av lämpligheten för expandera-kontraktera-mönstret i Miljöer med Master-Master Replikering (Swedish)
Abstract [en]

The field of software engineering is rapidly evolving, with increased development speed and frequency of deployments. These often require database schema migrations to accommodate new code changes. Blue-green deployments, where new and old versions of an application run concurrently, may necessitate databases to support two different schemas simultaneously. One solution for this is the expand-contract pattern.

The expand-contract pattern facilitates zero-downtime schema migrations by supporting both application versions concurrently. The expand phase allows both versions to coexist, followed by either a rollback to the initial schema or a contract phase to conform solely to the new schema.

Previously, the expand-contract pattern has been tested on master-slave replication, where the master handles both write and read operations, and the slave only handles reads. An alternative is master-master replication, where all instances handle both write and read operations. This setup is beneficial for higher write loads and offers redundancy if one master instance fails. However, the expand-contract pattern has not yet been evaluated in this context. This thesis assesses the pattern's impact on throughput and latency in a master-master replication environment.

To test this, an environment was set up using pgEdge for replication and conflict resolution, with schema migrations executed via Liquibase. Performance tests were conducted using HammerDB and the TPC-C database schema, both industry standards for database testing. The tests were conducted on a cluster simulated on a single laptop. While the laptop setup affects the database performance, the primary focus of the study is the performance change during schema migrations rather than the absolute performance.

The results suggest that caution should be taken when applying the expand-contract pattern under heavy update workloads combined with a higher amount of records in the table. Conversely, for tables with workloads dominated by insert operations, the pattern remains a viable option. Furthermore, once the migration execution was finished, the performance returned to normal.

Abstract [sv]

Programvaruteknik utvecklas snabbt, med ökad utvecklingshastighet och frekvens av distributioner. Dessa kräver ofta ändringar i databasens schema för att anpassa sig till nya kodändringar. Blå-grön-distributioner, där nya och gamla versioner av en applikation körs samtidigt, kan kräva att databaser stödjer två olika scheman samtidigt. En lösning för detta är expand-contract-mönstret.

Expand-contract-mönstret möjliggör schemaändringar utan driftstopp, där båda applikationsversionerna stöds samtidigt. Expand-fasen tillåter att båda versionerna kan existera parallellt, följt av antingen en återgång till det ursprungliga schemat eller en contract-fas för att enbart anpassa sig till det nya schemat.

Tidigare har expand-contract-mönstret testats på master-slave-replikering, där master hanterar både skriv- och läsoperationer, och slave endast hanterar läsningar. Ett alternativ är master-master-replikering, där alla instanser hanterar både skriv- och läsoperationer. Denna uppsättning är fördelaktig för högre skrivbelastningar och erbjuder redundans om en masterinstans fallerar. Expand-contract-mönstret har dock inte utvärderats i detta sammanhang. Denna avhandling undersöker mönstrets påverkan på genomströmning och latens i en master-master-replikeringsmiljö.

För att testa detta sattes en miljö upp med pgEdge för replikering och konfliktlösning, med schemaändringar utförda med Liquibase. Prestandatester genomfördes med HammerDB och TPC-C-databasschemat, båda industristandarder för databastestning. Testerna kördes i ett kluster simulerat på en bärbar dator. Detta påverkar databasens prestanda, däremot så fokuserar denna studie på prestandans förändring under schemaändringar och inte på den absoluta prestandan av databasen.

Resultaten visar att försiktighet bör iakttas vid tillämpning av expand-contract-mönstret under tunga uppdateringsbelastningar kombinerat med ett stort antal rader i tabellen. Däremot, för tabeller med arbetsbelastningar med högre grad av infogningstransaktioner ses mönstret som en rimlig strategi.

Place, publisher, year, edition, pages
Stockholm: KTH Royal Institute of Technology , 2024. , p. 40
Series
TRITA-EECS-EX ; 2024:720
Keywords [en]
Database schema migrations, Schema changes, Blue-Green deployments, Expand-contract, Rollback, Database replication, Multi-masterreplication
Keywords [sv]
Databasschemamigrationer, Schemaförändringar, Blå-gröna distribution, Expandera-kontraktera, Återställning, Databasreplikering, Multi-master replikering
National Category
Computer Sciences Computer Engineering
Identifiers
URN: urn:nbn:se:kth:diva-358969OAI: oai:DiVA.org:kth-358969DiVA, id: diva2:1931289
Subject / course
Computer Science
Presentation
2024-06-19, Room 4523, Lindstedtsvägen 5, Stockholm, 14:00 (English)
Supervisors
Examiners
Available from: 2025-02-17 Created: 2025-01-26 Last updated: 2025-02-17Bibliographically approved

Open Access in DiVA

fulltext(806 kB)55 downloads
File information
File name FULLTEXT01.pdfFile size 806 kBChecksum SHA-512
0f58c0cf4662a53c0b4b86e92fd8b85ab235060b86639dc4af5a709c5930e8aa905a0a6716aa2e67c51c2936f13d4f0b9c284d4b67a2ec11a6cd0f8523b5c724
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Ekberg, Johan
By organisation
School of Electrical Engineering and Computer Science (EECS)
Computer SciencesComputer Engineering

Search outside of DiVA

GoogleGoogle Scholar
Total: 55 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 213 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf