Catalogue / mailpace-2023-tech-stack

MailPace runs its Rails app on Clever Cloud in Paris, SMTP front ends on fly.io and outbound mail on Freethought VMs, linked by HTTP calls

MailPace, 2023. Whole stack (app and API, SMTP servers, storage).

Organisation
MailPace
Evidence
Reported from production
System
Whole stack (app and API, SMTP servers, storage)
As of
2023-09
Source
Our Tech Stack - boring tech, services not microservices, and no big cloud providers

MailPace blog, published 2023-09-22

Architecture

A Rails application with Postgres, Sidekiq and Redis serves the app and API on Clever Cloud in Paris. Several separate SMTP servers send email, receive email and provide the SMTP gateway. The services talk to each other with HTTP RPC calls, with Redis caches between them.

Section: Hosting: Clever Cloud | Section: SMTP Servers | Section: The bits in between: HTTP Services

Components

ComponentRoleWhere
App and APIReceives send requests and serves the email dashboard. Rails 7 with Turbo for the interactive parts.Section: App & API | Section: Front end and API: Rails
DatabasePostgres, the application's database.Section: Database: Postgres
Background jobsSidekiq, through ActiveJob, processes outbound email and many other background jobs, keeping job details and state in Redis.Section: Background Jobs: ActiveJob with Sidekiq and Redis
Inbound SMTP and SMTP gatewayCustom JavaScript SMTP servers on fly.io that receive email and accept mail from customers over SMTP.Section: Inbound SMTP & SMTP Gateway: JavaScript
Outbound SMTPZoneMTA with plugins that fetch DKIM keys in real time, run spam checks and update the database when emails are sent or bounce. Runs on Ubuntu VMs from Freethought, deployed with Capistrano.Section: Outbound SMTP: ZoneMTA (JavaScript)
Inter-service cachesRedis caches that sit between the services, which exchange data through HTTP RPC calls; the caches are there for speed and resilience.Section: The bits in between: HTTP Services
BackupsScheduled backups from Clever Cloud plus an additional backup to AWS S3 made with the backup gem.Section: Backups: Clever Cloud and AWS S3
Attachment storageClever Cloud Cellar, an S3 equivalent, holds attachments, which were moved there from Postgres.Section: Attachment storage: Clever Cloud Cellar
Cron VMA separate VM runs cron jobs and regularly sends the team email through MailPace itself.Section: Automation

Records

Decision#d1

Host the app, database and jobs on Clever Cloud in Paris, a managed platform, not on one of the three big clouds

mailpace-2023-tech-stack#d1 at corpus version 26a1b3a7e3dd
Chosen

The Rails app, database and jobs are hosted on Clever Cloud in Paris, deployed from the master branch on GitHub through a Dockerfile. The platform handles load balancing and horizontal and vertical scaling.

Section: Hosting: Clever Cloud

Reasoning

One of the team's three stated principles is to avoid Google, AWS and Azure and proprietary cloud-native services that only someone else can run, and to prefer European providers and locations. Using the platform means the team handles no operations infrastructure for the app.

Near: Avoid the big three cloud providers | Near: This means we don't handle any operations

Cost

The team reports little room to tune for performance or convenience: deployments take longer than it would like, maintaining the database needs the provider's support, and it relies on how the provider sets up VMs. It calls this a worthy trade-off overall.

Near: The downside of this is a lack

Decision#d2

Split the critical components into a few services that call each other over HTTP, not microservices

mailpace-2023-tech-stack#d2 at corpus version 26a1b3a7e3dd
Chosen

The app and API and the several SMTP servers (sending, receiving and the SMTP gateway) are separate services. They send and receive data with HTTP RPC calls, and Redis caches sit between the HTTP services.

Section: The bits in between: HTTP Services | Section: SMTP Servers

Reasoning

A stated principle is separation of responsibility for critical components, which the team sums up as services, not microservices. It says HTTP calls give some freedom and resiliency between components, and that it knows HTTP well and finds it trivial to use from any language.

Near: Separation of responsibility for our critical components | Section: The bits in between: HTTP Services

Decision#d3

Run outbound mail on plain VMs deployed with Capistrano, and the lightweight SMTP front ends on fly.io

mailpace-2023-tech-stack#d3 at corpus version 26a1b3a7e3dd
Chosen

Outbound email runs on ZoneMTA on Ubuntu VMs from Freethought, deployed with Capistrano. The custom inbound SMTP servers and the SMTP gateway run on fly.io and are deployed with fly deploy from a Dockerfile.

Section: Outbound SMTP: ZoneMTA (JavaScript) | Section: Inbound SMTP & SMTP Gateway: JavaScript

Reasoning

The team found ZoneMTA by far the easiest mail transfer agent to configure and write plugins for. The outbound servers rarely change, so it is content with simple, old-style server management for them. It chose JavaScript for the SMTP servers because it knows it well and finds node.js reasonably fast and light for asynchronous work.

Section: Outbound SMTP: ZoneMTA (JavaScript) | Near: We use JavaScript because a) we know

Decision#d4

Build on tools the team already knows (Rails, Postgres, Sidekiq with Redis)

mailpace-2023-tech-stack#d4 at corpus version 26a1b3a7e3dd
Chosen

The app and API are Rails 7, the database is Postgres, and background jobs, outbound email among them, run on Sidekiq with Redis holding job details and state.

Section: Front end and API: Rails | Section: Database: Postgres | Section: Background Jobs: ActiveJob with Sidekiq and Redis

Reasoning

The first stated principle is boring tech: things the team already knows how to use and that have been proven. The author calls Rails by far the simplest way to get a CRUD app running and easy to add features to, and allows that the API could be rewritten in Rust for some speed, perhaps in future.

Near: Use boring tech - we use things | Section: Front end and API: Rails

Decision#d5

Keep the provider's scheduled backups and a second copy at another provider, and test the restore

mailpace-2023-tech-stack#d5 at corpus version 26a1b3a7e3dd
Chosen

Backups are taken on regular schedules by Clever Cloud, and an additional backup goes to AWS S3 using the backup gem. The team says it has tested its restore process.

Section: Backups: Clever Cloud and AWS S3

Review

Extracted by
Claude (feed 45)
Human review
Not started. Status recorded on 2026-12-02.