Advanced System Design Fundamentals
Vote

0% completed

​

The Expand and Contract Pattern

An online store plans to ship this change in the same release as the code that uses it.

CREATE TABLE addresses (id BIGINT PRIMARY KEY, customer_id BIGINT, street TEXT, postal_code TEXT); ALTER TABLE orders ADD COLUMN address_id BIGINT REFERENCES addresses (id); ALTER TABLE orders DROP COLUMN shipping_address;

Today, each order keeps its shipping address as text in one column. Customers now want several saved addresses, so orders will point to a new table instead. Every line above is valid SQL, and yet the release would still break checkout for some customers.

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content