Switching user database on a running system
Jun 1, 2015Marcus Vesterlund

Summary
This post details the migration of Spotify's user database from PostgreSQL to Cassandra. The migration involved a 'darkloading' strategy where production requests were handled in parallel by both databases to ensure capacity and find bugs before the final switch. Existing accounts were migrated via a job that iterated over users, ensuring data synchronization. The switch itself was a configuration change followed by a synchronized restart of services. Challenges encountered included issues with Cassandra's Lightweight Transactions (LWT) and a bug in the Java driver.