Lessons in this course (14)

13. Case studies — notification service, file storage and ride booking (outlines)

AdvancedMediumLesson 13 of 14

Notification service: API receives "notify user X with template T" → validates preferences (opt-outs, quiet hours) → queues per channel (email, SMS, push) → workers call providers (SendGrid, Twilio, FCM) with retries and dead-letter queues → delivery status stored; rate limits per user; templates and localisation; idempotency keys to avoid duplicate sends.

File storage (like Dropbox/OneDrive): files split into chunks (e.g. 4 MB) with hashes → upload only changed chunks (deduplication) directly to object storage via signed URLs → metadata service (SQL) stores file tree, versions, chunk lists → sync service notifies other devices (long polling/WebSockets) → CDN for downloads; conflict handling with versions.

Ride booking (like Uber): drivers send location every few seconds → location service stores latest positions in an in-memory geo index (geohash/quadtree, Redis GEO) → rider requests a ride → matching service finds nearby available drivers and offers the trip → trip service manages state machine (requested → accepted → started → completed) → pricing (surge) and payment services → events to analytics. Strong consistency on assigning one driver per trip (conditional update/lock), eventual elsewhere.