Senior Track Roadmap

Vertical sharding

Vertical sharding moves whole tables to another database, while horizontal sharding splits the rows of one table. The course compares the two axes and shows that this Rails 8 application already splits its data into four database roles. It uses foreign keys to measure coupling and find seams. It explains which guarantees stop working across a seam and walks through the Rails setup for a new database. It closes by testing the one candidate table in this schema and a challenge that lists the queries a split would break.

What you'll learn

  • ✓The difference between horizontal and vertical sharding
  • ✓How Rails 8 gives queue, cache and cable tables their own database roles
  • ✓Measuring table coupling with foreign keys to find seams
  • ✓What stops working across a seam: joins, transactions and foreign key constraints
  • ✓Adding a database in Rails with connects_to and its own migration path
  • ✓Judging whether a movable table is worth moving
Free preview · Lesson 1 3 min read

Splitting tables, not rows

Vertical sharding moves whole tables to another database. Horizontal sharding splits one table's rows, and vertical sharding splits the set of tables.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...