SysPadExamples › Distributed email service

Distributed email service

Mail API → Mail Processor → spam/virus filter → delivery queue → a handler that fans out to attachment storage, metadata, search indexing, and SES for SMTP delivery.

Spam filtering as a mandatory gate before anything reaches the delivery queue.

Client Users Mail API API Gateway Mail Processor Lambda Spam/Virus Filter Lambda Delivery Queue SQS Delivery Handler Lambda Attachment Storage S3 Metadata Store DynamoDB Search Index OpenSearch AT LIMIT SMTP Delivery SES AT LIMIT

How it works

Spam/Virus Filter
The mandatory gate: nothing reaches the delivery queue until it clears spam and virus checks. It is the slowest step on the path (40ms) precisely because it is the one that must not be skipped.
Delivery Queue
The send returns once the mail lands here. Everything after - attachment write, metadata, indexing, the SMTP send itself - happens as the handler drains the queue, so a slow SES send never blocks the sender.
Delivery Handler
Fans one dequeued message out to four sinks at once: attachment storage (only when there is one), the metadata store, the search index, and SES for the actual send.

Request flows

Send an email

  1. Client
  2. Mail API
  3. Mail Processor
  4. Spam/Virus Filter
  5. Delivery Queue
  6. Delivery Handler
  7. Attachment Storage
  8. Metadata Store
  9. Search Index
  10. SMTP Delivery

Other interview practice

Open this architecture in SysPad · All examples