Signals and Threads

Building a functional email server with Dominick LoBraico

14 snips
Oct 28, 2020
Ask episode
AI Snips
Chapters
Transcript
Episode notes
INSIGHT

Email Server As A Composable Function

  • MailCore treated an email server as a pure function mapping an incoming message to zero or more outputs, letting OCaml's function composition express routing and transforms cleanly.
  • Replacing a bespoke macro-laden config language with OCaml made configuration composable, testable, and familiar to existing engineers.
ADVICE

Use Your Main Language For Config Generation

  • Avoid config-generation into a brittle DSL unless the target provides simple, stable primitives; instead use your team's main programming language for dynamic behavior.
  • They chose OCaml because existing tooling and expertise made runtime dynamism and refactorability practical.
ANECDOTE

Shadowing Old Server To Diff Behavior

  • They ran MailCore in shadow mode: every incoming message was forked to the new OCaml server while the old server continued handling live mail, and outputs were streamed and diffed.
  • This exposed subtle mismatches and revealed several cases where the legacy server behaved incorrectly.
Get the Snipd Podcast app to discover more snips from this episode
Get the app