frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Using the expand and contract pattern for schema changes

https://www.prisma.io/dataguide/types/relational/expand-and-contract-pattern
27•tanelpoder•1w ago

Comments

leetrout•1h ago
I use this example when I speak about and teach devops trainings.

I call it the migration sandwich. (Nothing to do with the cube rule).

A piece of bread isn't a sandwich and a single migration in a tool like alembic isn't a "sandwich" either. You have a couple layers of bread with one or several layers of toppings and it's not a sandwich until it's all done.

People get a laugh out of the "idiot sandwich meme" and we always have a good conversation about what gnarly migrations people have seen or done (72+ hours of runtime, splitting to dozens or more tables and then reconstructing things, splitting things out to safely be worked on in the expanded state for weeks, etc).

I had never heard it called "expand and contract" before reading this article a few years ago.

What does everyone else call these?

hobs•33m ago
To me is just a blue-green type deployment for schemas. You have an old and a new thing, you split and merge as traffic replays to the new thing and shows that its viable and not breaking, you swap over as you can.
fuzzy2•1h ago
I’m confused. I thought Expand and Contract was about mutating an existing schema, adding columns and tables, not creating a full replacement schema. But maybe I misunderstood?

What’s in the article, I know as the Strangler Fig Pattern.

jerriep•1h ago
What you describe is what they describe as well:

> For column-level changes, this often means adding new columns to a table that have the characteristics you want while leaving the current columns as-is.

I think what makes it confusing is that their diagrams depict a completely separate schema, but what they describe is really just altering the existing schema.

DeathArrow•55m ago
> What’s in the article, I know as the Strangler Fig Pattern.

Strangler fig pattern is mostly concerned with migrating from an old software to a new software, from example from a monolith to microservices. But I guess you can also apply it to database schemas.

sarchertech•52m ago
This is just the natural solution that falls out if you want to change a schema with no downtime. I always just called it “dual writing”.
skywhopper•21m ago
This is the model we used at the SaaS I worked for a decade ago. It worked great to allow for smooth, zero-downtime upgrades across a fleet of thousands of DB servers serving tens of thousands of app servers and millions of active users.
maffyoo•14m ago
Expand Contract from Fowler's bliki

https://martinfowler.com/bliki/ParallelChange.html

Interesting SPI Routing with iCE40 FPGAs

https://danielmangum.com/posts/spi-routing-ice40-fpga/
7•hasheddan•42m ago•0 comments

Installing and using HP-UX 9

https://thejpster.org.uk/blog/blog-2025-11-08/
69•TMWNN•5h ago•19 comments

Beets: The music geek’s media organizer

https://beets.io/
123•hyperific•7h ago•53 comments

Show HN: What Is Hacker News Working On?

https://waywo.eamag.me/
135•eamag•3d ago•29 comments

Using the expand and contract pattern for schema changes

https://www.prisma.io/dataguide/types/relational/expand-and-contract-pattern
27•tanelpoder•1w ago•8 comments

Marble Fountain

https://willmorrison.net/posts/marble-fountain/
754•chris_overseas•21h ago•83 comments

DNS Provider Quad9 Sees Piracy Blocking Orders as "Existential Threat"

https://torrentfreak.com/dns-provider-quad9-sees-piracy-blocking-orders-as-existential-threat/
96•gslin•3h ago•38 comments

XSLT RIP

https://xslt.rip/
474•edent•6h ago•305 comments

Europe to decide if 6 GHz is shared between Wi-Fi and cellular networks

https://www.theregister.com/2025/11/09/europe_to_decide_if_6/
77•FridayoLeary•3h ago•54 comments

These Men dove to the Edmund Fitzgerald shipwreck decades ago. Their stories

https://www.freep.com/story/news/local/michigan/2025/11/02/edmund-fitzgerald-wreck-diving/8675251...
35•rmason•1w ago•7 comments

Montana becomes first state to enshrine 'right to compute' into law

https://montananewsroom.com/montana-becomes-first-state-to-enshrine-right-to-compute-into-law/
473•bilsbie•1d ago•267 comments

Ask HN: What Are You Working On? (Nov 2025)

301•david927•17h ago•886 comments

How the UK lost its shipbuilding industry

https://www.construction-physics.com/p/how-the-uk-lost-its-shipbuilding
150•surprisetalk•12h ago•305 comments

DEC64: Decimal Floating Point (2020)

https://www.crockford.com/dec64.html
57•vinhnx•1w ago•25 comments

Pose Animator – An open source tool to bring SVG characters to life (2020)

https://blog.tensorflow.org/2020/05/pose-animator-open-source-tool-to-bring-svg-characters-to-lif...
6•jerlendds•6d ago•0 comments

Realtime BART Arrival Display

https://filbot.com/real-time-bart-display/
156•Jadrago•7h ago•34 comments

Itiner-e: the Google Maps of Roman Roads

https://itiner-e.org/
135•helsinkiandrew•1d ago•33 comments

Drilling down on Uncle Sam's proposed TP-Link ban

https://krebsonsecurity.com/2025/11/drilling-down-on-uncle-sams-proposed-tp-link-ban/
227•todsacerdoti•20h ago•286 comments

BGP zombies and excessive path hunting

https://blog.cloudflare.com/going-bgp-zombie-hunting/
21•emot•1w ago•3 comments

Building a 2.5kWh battery from disposable vapes to power my workshop [video]

https://www.youtube.com/watch?v=dy-wFixuRVU
245•rsanek•6d ago•128 comments

Today I Learned: Binfmt_misc

https://dfir.ch/posts/today_i_learned_binfmt_misc/
78•malmoeb•6d ago•20 comments

Lee Felsenstein

https://en.wikipedia.org/wiki/Lee_Felsenstein
39•nickt•6d ago•13 comments

JVM exceptions are weird: a decompiler perspective

https://purplesyringa.moe/blog/jvm-exceptions-are-weird-a-decompiler-perspective/
137•vrnvu•6d ago•43 comments

The Manuscripts of Edsger W. Dijkstra

https://www.cs.utexas.edu/~EWD/
240•nathan-barry•22h ago•101 comments

Understanding Financial Functions in Excel

https://ciju.in/writings/understanding-financial-functions-excel-sheets
62•ciju•5d ago•6 comments

The Principles of Diffusion Models

https://arxiv.org/abs/2510.21890
205•Anon84•22h ago•20 comments

A brief history of Time Machine (2024)

https://eclecticlight.co/2024/09/07/a-brief-history-of-time-machine/
30•firloop•6d ago•16 comments

Bumble Berry Pi – A Cheap DIY Raspberry Pi Handheld Cyberdeck

https://github.com/samcervantes/bumble-berry-pi
173•MakerSam•21h ago•34 comments

The Linux Kernel Looks to “Bite the Bullet” in Enabling Microsoft C Extensions

https://www.phoronix.com/news/Linux-6.19-Patch-Would-MS-Ext
66•keyle•6h ago•32 comments

EU takes aim at plastic pellets to prevent their nightmare cleanup

https://www.yahoo.com/news/articles/eu-takes-aim-plastic-pellets-030314496.html
91•PaulHoule•5h ago•50 comments