Running a lettings CRM on AWS: what runs where, and why

Asadullah7 min read

The short answer

Hosting a CRM on AWS comes down to a few jobs: a managed Postgres database, somewhere to run the web app and the API, workers and a queue for background tasks, private file storage behind a CDN, and a deploy pipeline that ships one tested image to each environment. Propily runs that shape in AWS's London region, with the web app on managed containers behind a CDN, the API and its workers in Docker on a server, and the database, files and email on managed AWS services. This article covers what runs where, how deploys, secrets, backups and alerts work in principle, and what we moved off Supabase and Upstash.

What runs where in a lettings CRM on AWS

The browser talks to a Next.js web app. That app runs as a container on a managed container service, behind a load balancer and a CDN, and scales out on CPU and memory. It proxies API calls server side, so the browser calls a single origin.

The API is a FastAPI application on a server, run with Docker Compose. Compose starts nginx in front, the API with a small number of worker processes, a Celery worker for general background jobs, a second worker that handles only WhatsApp and webhook traffic, the Celery scheduler, Redis, and a self-hosted e-signature service with its own small database. WhatsApp gets its own lane because a client's message should not wait behind a scheduled scan or an import.

State lives elsewhere. Postgres runs on RDS, encrypted, with TLS forced, not publicly accessible and reachable only from the backends. Files sit in a private S3 bucket behind CloudFront: listing images are served unsigned and everything else needs a signed URL. Outbound email goes through SES using the server's own AWS role, so there is no mail API key to store. Not everything is AWS. AI model providers and messaging channels such as WhatsApp and voice are external services we call.

How deploys reach the servers

Every commit on the deploy branches builds one container image, scans it and pushes it to a private registry tagged with the commit. Staging pulls that image. Production later re-tags the identical image, so production runs the bytes that were verified on staging.

The API host is reached through AWS Systems Manager rather than SSH. The deploy script pulls the image, recreates only the services that changed, reloads nginx and waits for the health endpoint. The pipeline then checks from outside, through the public edge, that the running commit matches, and if that fails it redeploys the previous build recorded on the host. Before any of that, a guard compares the database's migration revision with what the new code expects and refuses to deploy onto a database that is behind.

The web app deploys differently. The pipeline registers a new task definition, waits for the service to be stable, checks target health, invalidates the CDN cache and confirms the live build identifier, with automatic rollback to the previous task definition. CI authenticates to AWS with short-lived federated credentials rather than stored keys, and the role that pushes images cannot deploy.

The API deploy recreates only the services that changed, and the worst case is a few seconds of errors while the API restarts. We do not claim zero downtime.

How secrets and configuration are handled

The principle is to keep secrets out of git, give each one the narrowest home that fits, and let machines use roles instead of keys wherever AWS allows it. In practice:

  • The database's master credential is created and held by RDS in AWS Secrets Manager. It never appears in a template.
  • S3 and SES access for the API come from the server's IAM role, not from keys.
  • The web app's runtime settings are injected into its task definition at deploy time, and the deploy refuses to continue if one is empty. Anything exposed to the browser is treated as public.
  • CI scans each new commit for committed secrets.

Backups and durability, in principle

RDS takes automated daily backups with a retention window, deletion protection is on, and deleting the stack takes a final snapshot first. The file bucket is versioned, with old versions expiring after a set time. We snapshot the database before applying a large migration chain. The records live in Postgres, and Redis holds queues and short-lived keys with append-only persistence.

Redis is configured so that a full instance cannot silently drop queued jobs. It evicts only keys that carry a time limit, and Celery's queue keys do not. A backup is only proven by a restore, so rehearsing one is the check to schedule.

# Redis in docker-compose: persist to disk, cap memory, and
# only ever evict keys that have a TTL (rate limits, caches).
# Celery queue keys have no TTL, so queued jobs are never dropped.
redis-server --appendonly yes --maxmemory <limit> --maxmemory-policy volatile-lru

Monitoring and alerts, in principle

CloudWatch alarms cover three layers. For the server: status checks with automatic recovery, sustained CPU and burst credits. For the database: CPU, memory, storage, connections, and slow queries logged above a threshold. For the web tier: CPU, memory, no running tasks, unhealthy targets and the CDN's error rate. Alarms notify an alert topic.

The API can also publish application metrics, such as 5xx count, 95th percentile latency, queue depth, scheduler heartbeat and Redis evictions, once that setting is on. Container logs rotate on the host. Shipping them to CloudWatch Logs is an opt-in override, because a permissions mistake would stop containers starting.

What we moved off Supabase and Upstash, and why

Early on, the database and files lived on Supabase and Redis on Upstash. Today production Postgres runs on RDS, files are in S3 behind CloudFront, and Redis is a container on the API host. The backend's Supabase storage client and settings have been removed, and production requires the S3 storage backend.

The Redis move was forced. Our hosted Redis was suspended on 28 September, which took out background jobs and the login rate limiter until we moved it. For the database and files, the plan was to end up with one cloud to manage, and our runbook's rule was reversible steps: run each replacement beside the old service, and switch nothing off until it has been verified.

Stored file URLs were the surprise. The old storage handed out year-long signed links, and we had saved them in the database: logos, signed contract PDFs, chat media. S3 presigned links expire far sooner, so we put CloudFront in front of the bucket, issue CloudFront signed URLs, and wrote a script to rewrite the stored ones. The Redis cutover also taught us that a change to the compose file in the repository does not reach the server on its own.

Questions about hosting worth asking any CRM vendor

Ask where the data is stored and in which region, how a bad release is reversed, how backups are tested, and which parts of the stack are single points of failure. Our letting agent software page describes what Propily covers once it is running.

Questions people ask

What AWS services does a SaaS CRM need?

At minimum: compute for the web app and API, a managed database, object storage with a CDN, a cache or queue for background work, an email service, a container registry, a deploy path and alarms. Propily uses RDS, S3, CloudFront, SES, ECR, CloudWatch and Systems Manager, managed containers for the web app and a Docker host for the API.

Where is Propily's data hosted?

The database, files and outbound email run in AWS's London region. Some features call external providers, such as AI models and messaging channels, so saying everything sits in London would overstate it.

Does a deploy cause downtime?

We do not claim zero downtime. Redeploying the API can produce a few seconds of errors while the backend restarts. The web tier keeps its running tasks until the new ones pass health checks.

Does Propily still use Supabase or Upstash?

Not in the current code. Production Postgres runs on RDS, files on S3 behind CloudFront and Redis in a container on the API host, and the backend's Supabase storage client has been removed.

Who answers your phones tonight?Book a demo
Hosting a CRM on AWS: how we run a lettings platform | Propily