~/talk

How to Build a State Machine on MongoDB and Redis

links:none on file
slides:none on file

CRM flow engine Canvas pairs MongoDB for single-write user state with Redis for coordination and caching, using Sidekiq/sidekick jobs. Key techniques: a Redis lock key: journeyID+userID+entryTimestamp to guarantee single-branch progression, an extra read-before-lock to cut a ~20–30% wrong-lock rate, and batching users into Redis sets with dispatch jobs pulling ~200 users to reduce millions of per-branch jobs to orders of magnitude fewer (≈thousands). The system commits one MongoDB write at send time and uses Redis-held branch IDs for debugging.

AI-written summary · about

  1. 0:00State machine on MongoDB and Redis
  2. 1:24Company background
  3. 2:46Canvas state machine motivation
  4. 5:15User state tracking
  5. 9:33Branching challenges
  6. 13:06Redis locks for transitions
  7. 16:57Optimizing lock checks
  8. 17:19Batching jobs for loads
  9. 20:08Redis sets for dispatching
  10. 22:14Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.