{"type":"excalidraw","version":2,"source":"https://AwesomeSystemDesign.dev","elements":[{"angle":0,"strokeColor":"#6577aa","backgroundColor":"#eef1fc","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-1"}],"updated":0,"link":null,"locked":false,"id":"shape-0","type":"rectangle","seed":41,"x":16,"y":16,"width":288,"height":465,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-1"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-1","type":"text","seed":114,"x":36,"y":34,"width":248,"height":429,"fontSize":22,"fontFamily":1,"text":"Producer (Message\nService)\n\nOn new message:\n1. Write to\nCassandra\n(persistent store)\n2. Publish to Kafka\n(for async delivery)\n\nPartition key:\nconversation_id\n→ Guarantees\nordering within a\nconversation","originalText":"Producer (Message\nService)\n\nOn new message:\n1. Write to\nCassandra\n(persistent store)\n2. Publish to Kafka\n(for async delivery)\n\nPartition key:\nconversation_id\n→ Guarantees\nordering within a\nconversation","textAlign":"left","verticalAlign":"middle","containerId":"shape-0","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":1}},{"angle":0,"strokeColor":"#6577aa","backgroundColor":"#eef1fc","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-3"},{"type":"arrow","id":"shape-4"}],"updated":0,"link":null,"locked":false,"id":"shape-2","type":"rectangle","seed":187,"x":16,"y":525,"width":288,"height":93.2,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-3","type":"text","seed":260,"x":36,"y":543,"width":248,"height":57.2,"fontSize":22,"fontFamily":1,"text":"Producer (Message\nService)","originalText":"Producer (Message\nService)","textAlign":"left","verticalAlign":"middle","containerId":"shape-2","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#6577aa","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":2,"strokeStyle":"solid","roughness":0.4,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-4","type":"arrow","seed":333,"x":36,"y":632.2,"width":0,"height":28,"points":[[0,0],[0,28]],"lastCommittedPoint":null,"startBinding":{"elementId":"shape-2","focus":0,"gap":14},"endBinding":{"elementId":"shape-5","focus":0,"gap":14},"startArrowhead":null,"endArrowhead":"arrow","elbowed":false,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#628572","backgroundColor":"#edf5ee","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-6"},{"type":"arrow","id":"shape-4"}],"updated":0,"link":null,"locked":false,"id":"shape-5","type":"rectangle","seed":406,"x":16,"y":674.2,"width":288,"height":693.8000000000001,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-2"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-6","type":"text","seed":479,"x":36,"y":692.2,"width":248,"height":657.8000000000001,"fontSize":22,"fontFamily":1,"text":"Consumer Group:\n\"delivery-workers\"\n\nWorker 1 → Partitions\n[0-15]\nWorker 2 → Partitions\n[16-31]\nWorker 3 → Partitions\n[32-47]\nWorker 4 → Partitions\n[48-63]\n\nEach worker:\n1. Check if recipient\nis online\n→ YES: push via\nWebSocket\n→ NO: enqueue for\noffline delivery\n2. Send push\nnotification if offline\n3. Commit Kafka\noffset after ACK","originalText":"Consumer Group:\n\"delivery-workers\"\n\nWorker 1 → Partitions\n[0-15]\nWorker 2 → Partitions\n[16-31]\nWorker 3 → Partitions\n[32-47]\nWorker 4 → Partitions\n[48-63]\n\nEach worker:\n1. Check if recipient\nis online\n→ YES: push via\nWebSocket\n→ NO: enqueue for\noffline delivery\n2. Send push\nnotification if offline\n3. Commit Kafka\noffset after ACK","textAlign":"left","verticalAlign":"middle","containerId":"shape-5","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":2}},{"angle":0,"strokeColor":"#a68a53","backgroundColor":"#fff7e6","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":[{"type":"text","id":"shape-8"}],"updated":0,"link":null,"locked":false,"id":"shape-7","type":"rectangle","seed":552,"x":16,"y":1412,"width":288,"height":1065.6000000000001,"customData":{"revealStep":3}},{"angle":0,"strokeColor":"#394557","backgroundColor":"transparent","fillStyle":"solid","strokeWidth":1.5,"strokeStyle":"solid","roughness":0.7,"opacity":100,"version":1,"versionNonce":1,"isDeleted":false,"groupIds":["step-3"],"frameId":null,"roundness":null,"boundElements":null,"updated":0,"link":null,"locked":false,"id":"shape-8","type":"text","seed":625,"x":36,"y":1430,"width":248,"height":1029.6000000000001,"fontSize":22,"fontFamily":1,"text":"Kafka Message\nDelivery Pipeline\n\nTopic: \"messages\"\nPartitions: 64 (keyed\nby conversation_id)\n\nDelivery Guarantees:\n\nAt-least-once\ndelivery:\n- Kafka consumer\ncommits offset\nAFTER\nsuccessful delivery\n- If worker crashes\nbefore commit,\nmessage re-delivered\non restart\n\nIdempotency:\n- Client deduplicates\nby message_id\n- Server-side: unique\nconstraint on\n(conversation_id,\nmessage_id)\n\nOrdering:\n- Kafka partition key\n= conversation_id\n- Messages within\nsame conversation\nalways\nin same partition →\nstrict FIFO","originalText":"Kafka Message\nDelivery Pipeline\n\nTopic: \"messages\"\nPartitions: 64 (keyed\nby conversation_id)\n\nDelivery Guarantees:\n\nAt-least-once\ndelivery:\n- Kafka consumer\ncommits offset\nAFTER\nsuccessful delivery\n- If worker crashes\nbefore commit,\nmessage re-delivered\non restart\n\nIdempotency:\n- Client deduplicates\nby message_id\n- Server-side: unique\nconstraint on\n(conversation_id,\nmessage_id)\n\nOrdering:\n- Kafka partition key\n= conversation_id\n- Messages within\nsame conversation\nalways\nin same partition →\nstrict FIFO","textAlign":"left","verticalAlign":"middle","containerId":"shape-7","lineHeight":1.3,"autoResize":false,"customData":{"revealStep":3}}],"appState":{"viewBackgroundColor":"#fbfbf8","gridSize":null},"files":{}}