~/talk

Horizontally Scaling Your Database with Django

Talkat PyCon Canada 2012 · 2012-11-09..11-11· [django, databases]
links:none on file
slides:none on file

Compares three practical steps: scale up then feature partitioning then sharding, with concrete tradeoffs (lose cross-db foreign keys, select_related, cascades). Uses and extends DJ_DATABASE_URL for many DB URIs and adds shard group metadata, implements an app-based router and instance.get_shard delegation, and provides a custom management command plus South migration hacks to run migrations across every shard. Chooses many logical shards per physical node, avoids automatic balancing, and recommends Snowflake-style 64-bit IDs for globally unique keys.

AI-written summary · about

  1. 0:00Intro
  2. 2:51separate databases
  3. 3:07dj-database-url
  4. 3:19Setup more databases
  5. 3:30Database Router for Feature Partitioning
  6. 4:17Databases for Read and Write
  7. 4:46Relationships between different instances
  8. 5:32Syncing the Database
  9. 6:32Multi-database applications have a cost
  10. 7:48Multiple databases with the same schema
  11. 9:00Good sharding key?
  12. 9:21Harder to Shard
  13. 9:53Bad sharding key?
  14. 10:55Database Definitions
  15. 11:23Extending South
  16. 12:56db_for_read() method
  17. 13:56instance.get_shard()
  18. 14:21allow_relation() method
  19. 14:37allow_syncdb() method
  20. 14:56Reading from a shard
  21. 15:18Writing to a shard
  22. 15:47Many Logical Shards per Physical Node
  23. 16:10Table Alterations are faster
  24. 16:40Obtain globally unique IDs
  25. 17:01Use an AUTO_INCREMENT column
  26. 17:36ID Generator
  27. 18:37In Summary
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.