← Graph

Multi-region data governance in Rails application

talk 24 connections

Miron Marczuk's wroclove.rb 2023 talk (his first public tech talk). Tells the story of Apply4's journey from a single-region UK multi-tenant Rails SaaS to a fully separated multi-region multi-tenant setup after US clients required their data to be stored in-region. Compares three architectural options (separate data only, fully separate applications, or a hybrid) and explains why Apply4 picked full separation based on three framing questions (can tenants move across regions? how much data is shared? can users operate across regions?). Breaks the migration into two stages: (1) redirect users to the correct region using Route 53 geolocation DNS and load-balancer path-based rules (app.apply4.com → region-specific URLs, with 302 redirects after 301 was cached too aggressively by Chrome, plus SEO alternate links); (2) separate the data by categorizing tables as shared vs region-specific, adding an integer 'bucket' column (via a Rails enum with values not_bucketed/region_1/region_2/shared), top-down bucketing starting from the Authority model's country attribute, previewing via default_scope, and swapping tables by creating an empty copy, inserting only in-region records, and renaming (with a 10% ID buffer to avoid ID clashes). Also covers file-system split by adding region-aware parent folders and using AWS DataSync. Go-live advice: inform clients, schedule low-usage maintenance window, write a detailed runbook, prepare contingency/revert plan, rehearse repeatedly, and use DNS records as the final trigger. Q&A covered logging and business-report aggregation across regions, and why table swap beats deletion.

type
talk
talk Multi-region data governance in Rails application
about
Multi-Tenancy concept
Starts from a multi-tenant Rails SaaS and extends it to multi-region multi-tenant.
talk Multi-region data governance in Rails application
about
Walk-through is specifically about a Rails application migration.
talk Multi-region data governance in Rails application
about
Bucketing concept
Central technique of the talk: tag every record with a target region bucket before splitting.
talk Multi-region data governance in Rails application
about
Talk details top-down bucket assignment starting from the Authority's country.
talk Multi-region data governance in Rails application
about
Explains the empty-copy + rename strategy for separating per-region tables.
talk Multi-region data governance in Rails application
about
Covers adding a region-prefix parent folder so files can be relocated in bulk.
talk Multi-region data governance in Rails application
about
Uses Route 53 geolocation to direct users to the nearest load balancer.
talk Multi-region data governance in Rails application
about
Uses a Rails default_scope on the bucket column to preview per-region data before split.
talk Multi-region data governance in Rails application
about
Frames the architectural decision around three candidate options.
talk Multi-region data governance in Rails application
about
Specifically uses Route 53 geolocation for the first stage of migration.
talk Multi-region data governance in Rails application
about
Path-pattern load balancer redirects handle cross-region URL corrections.
talk Multi-region data governance in Rails application
about
Recommends DataSync for bulk file transfer when splitting millions of files.
talk Multi-region data governance in Rails application
about
Apply4 company
Case study is Apply4's migration from a UK-only to a UK+US multi-region SaaS.
asked_at
Multi-region data governance in Rails application talk
First Q&A question about logging, analytics aggregation and data-extraction locality.
asked_at
Multi-region data governance in Rails application talk
Second Q&A question asking why Apply4 renames tables instead of deleting unwanted rows in place.
person Miron Marczuk
authored
Multi-region data governance in Rails application talk
Miron delivered this talk at wroclove.rb 2023 — his first-ever public tech conference talk.
from_talk
Multi-region data governance in Rails application talk
Miron's #1 tip — break the migration into deployable stages.
from_talk
Multi-region data governance in Rails application talk
Apply4 had to switch from 301 to 302 because Chrome cached 301s too aggressively.
from_talk
Multi-region data governance in Rails application talk
Reminder to set alternate-link tags when splitting one app into multiple region-specific siblings.
from_talk
Multi-region data governance in Rails application talk
Lesson learned while bucketing Apply4 records.
from_talk
Multi-region data governance in Rails application talk
Q&A lesson — empty copy + rename was faster than deleting unwanted rows.
from_talk
Multi-region data governance in Rails application talk
Miron's explicit go-live recommendation.
from_talk
Multi-region data governance in Rails application talk
Miron's go-live planning advice including contingency and DNS-flip trigger.
talk Multi-region data governance in Rails application
presented_at
Talk presented at wroclove.rb 2023 in Wrocław.

Provenance

Created
2026-04-17 16:17 seed
Last updated in
Multi-region data governance in Rails application 2026-04-17 22:12
Read by
33 extractions