In recent weeks I've been tasked with tracking down some issues in CartoDB related to some duplicate tables appearing in some users' dashboards. It was a race condition in a process we call "ghost table linkage", that helps the editor keep up with changes in the user's db.
The issue was fixed implementing a redis lock following the RedLock alghorithm. You can find our implementation (the horrendously named Carto::Bolt
) here.
I decided to keep on and try to refactor the whole user db-editor sync a bit. That's what this piece is about: How the CartoDB editor tracks physical table changes in the user's database.