Stop 2 AM outages with cloud based managed services

By Mark Hayes
Stop 2 AM outages with cloud based managed services

Outages at early-stage startups rarely come from anything exotic. They come from a disk that filled up, a certificate that expired, a backup script that stopped running three weeks ago, or an OS update that restarted a service with the wrong config. They tend to surface at night because that's when scheduled jobs run and nobody is watching.

Cloud based managed services exist to take these failure modes off your hands. The term covers a lot, from full IT outsourcing contracts to a managed Postgres instance. This post looks at it from one angle: for a single founder running a small SaaS, which specific failures does outsourcing infrastructure management prevent, which responsibilities stay with you, and how do you move over without writing an Nginx config or a backup cron job ever again.

A working definition

Cloud based managed services means handing the operation and maintenance of cloud infrastructure to a third party. The provider takes on tasks like:

  • provisioning and patching the underlying servers and operating systems,
  • running and upgrading database engines,
  • taking, storing and restoring backups,
  • terminating TLS, load balancing and restarting failed processes,
  • monitoring the infrastructure layer and responding to its failures.

For large organizations this is often a services contract. For a small team it's usually a platform: you deploy an app, attach a database, create a storage bucket, and the provider operates everything below your code.

The useful way to think about it is the shared responsibility model, which the major cloud providers use to describe security and operations boundaries. Every piece of your stack is operated either by you or by the provider. Managed services move the line upward.

The five failure modes behind most MVP outages

Here are the incidents that actually happen to solo founders on self-managed servers, roughly in order of frequency.

1. The disk fills up

Postgres WAL files, Docker images and build cache, application logs, uploads saved locally. Any of these can fill a 25–50 GB disk. When the disk is full, Postgres can no longer write, and depending on what fills first, it may refuse to start until you free space.

If you're still on a VPS, you can check where you stand right now:

df -h /
sudo du -xh --max-depth=1 /var/lib | sort -h | tail
docker system df

And inside Postgres:

SELECT pg_size_pretty(pg_database_size(current_database()));
SELECT pg_size_pretty(sum(size)) FROM pg_ls_waldir();

A large WAL directory often points to an abandoned replication slot or failing archiving. Both are classic causes of a silent disk fill.

2. Backups that aren't really backups

The typical DIY setup is a cron job running pg_dump to the same disk, or to S3 with credentials that expired. The script stops working and nobody notices, because nothing reads the backups until the day you need them.

Test your current setup honestly:

  • When was the last backup taken? Check timestamps, not the crontab.
  • Is it stored off the machine?
  • Have you restored it in the last month?

If any answer is "not sure", you effectively have no backup.

3. Expired or misconfigured TLS

Let's Encrypt certificates last 90 days. certbot renewal usually works, until a DNS change, a firewall rule or an Nginx config edit breaks the challenge. The result is a browser warning that scares off every beta user who sees it.

4. Memory exhaustion and the OOM killer

An app, Postgres, Redis and a build process sharing 2 GB of RAM. One traffic spike or a docker build on the production box, and the kernel's OOM killer picks a victim. It's often Postgres, because it's the biggest process.

5. Unattended changes

Automatic OS updates restarting Docker, a dependency pulled at latest, a config file edited by hand at 1 AM and never committed. None of these are bugs in your code, but all of them are downtime.

What managed services take off your list

Mapping those failure modes onto a managed setup gives a clearer picture than any feature table:

Failure modeSelf-managed VPSCloud based managed services
Disk fullYou monitor and resizeProvider manages database storage; app containers are stateless
BackupsYou script, store, and testAutomatic backups operated by the provider
TLSYou run and fix certbotCertificates issued and renewed by the platform
OOM killsEverything shares one boxApp and database run in isolated resources
OS and engine patchesYou schedule and hopeProvider patches the underlying layers
Process crashessystemd or Docker restart policy you configurePlatform restarts failed instances and uses health checks

What remains yours is just as important:

  • Your code and its bugs. A memory leak is still a memory leak.
  • Your schema and queries. A missing index will still make pages slow.
  • Your secrets. Rotate them, and keep them out of Git.
  • Your data decisions. Retention, deletion requests, what you log.
  • Verifying restores. Even with automatic backups, you should know how to restore and should try it once.
Key point: managed services don't make outages impossible. They move infrastructure failures to a team whose full-time job is preventing them, which leaves you with only the failures your own code can cause.

Recovery objectives, in plain terms

Two concepts from operations practice help you judge any provider, including your current setup.

  • RPO (recovery point objective): how much data you can afford to lose. With nightly pg_dump, the RPO is up to 24 hours. Losing a day of beta-user signups before a demo is painful.
  • RTO (recovery time objective): how long you can afford to be down. On a DIY box at 2 AM, the RTO is however long it takes you to wake up, SSH in, and figure it out. Six hours is not unusual.

When you evaluate a managed database, ask how often backups run, how long they're kept, whether point-in-time recovery is available, and how a restore is done. Write down the answers. They're your new RPO and RTO.

Moving to managed services without touching a server

The transition itself is simple if you treat it as three separate moves: app, data, files.

Step 1: containerize and connect the repository

If you have a working Dockerfile or docker-compose.yml, the app is ready. Make sure configuration comes from environment variables and the app listens on the port it's given.

On a platform like Granite.so, you connect your GitHub or GitLab repository, choose a branch, and every push triggers a build and deploy from your Dockerfile. There's no reverse proxy to configure, no TLS setup, and no systemd unit file.

Step 2: move the database to a managed instance

Create a managed database with the same engine and major version as your current one. Automatic backups are part of the service, so the backup cron job goes away. Then move the data with a short maintenance window:

# 1. Stop writes (maintenance mode or stop the app)
# 2. Dump from the old server
pg_dump "$OLD_DATABASE_URL" -Fc --no-owner --no-acl -f app.dump

# 3. Restore into the managed database
pg_restore --no-owner --no-acl -d "$NEW_DATABASE_URL" app.dump

# 4. Verify row counts on key tables
psql "$NEW_DATABASE_URL" -c "SELECT count(*) FROM users;"

Use pg_dump and pg_restore versions that match the server's major version, or newer ones. Then point DATABASE_URL at the new instance and redeploy.

Step 3: move files to S3-compatible storage

Anything the app writes to local disk should go to object storage. Uploads on disk are one of the main reasons disks fill up in the first place. Copy existing files with a standard tool:

aws s3 sync /var/www/app/uploads s3://my-app-uploads/ \
  --endpoint-url "$S3_ENDPOINT"

Update your app's S3 client to read the endpoint, bucket and keys from environment variables. With a CDN in front of the bucket, static files load faster and don't consume app resources.

Step 4: retire the old server deliberately

Don't delete it the same day. Keep it stopped, not destroyed, for a week, and take a final snapshot. Then remove it and cancel the plan. One less invoice.

Making the budget predictable

Outage anxiety and billing anxiety have the same cause: something that grows without you noticing. Two principles help:

  1. Prefer a fixed base with a clear allowance over pure per-minute metering, so month-to-month variance stays small.
  2. Know your cost drivers. Memory, storage size and egress are the usual ones. Look at the usage view weekly for the first month.

As a concrete reference point, Granite.so's Hobby plan costs $9/month and includes $15 in usage credits, which is typically enough for a small app with a managed database at MVP scale. Teams that need more headroom can move to the Advanced plan ($39/month with $50 of usage credits). Usage beyond the included credits is billed at $1 per credit, so check the pricing details before you decide. Either way, the number you pay no longer depends on whether a backup script silently broke.

A short audit you can run this week

Even if you're not moving yet, answer these for your current setup:

  1. What's the free disk space on the database host, and how fast is it shrinking?
  2. When was the last successful backup, and where is it?
  3. When did you last restore a backup?
  4. When does your TLS certificate expire?
  5. What happens if the database process is killed? Does it restart on its own?
  6. Who gets alerted, and how, if the site goes down at 2 AM?
  7. What was last month's infrastructure bill, and can you explain every line?

Every "I don't know" is a risk that cloud based managed services are designed to remove. If you have more than two, the move is probably worth an afternoon.

Conclusion

Late-night outages at the MVP stage are almost always infrastructure problems, not product problems: disks, backups, certificates, memory, unattended changes. Managed services move those responsibilities to a provider and leave you with the part only you can do, which is the product.

If you'd like to put the app, a managed Postgres with automatic backups and S3-compatible storage on one dashboard with a known monthly base cost, you can set it up on Granite.so by connecting your repository. Then run the audit above one more time and enjoy answering "not my problem" to most of it.

Keep reading

More posts tagged “Community”.
Be first in line for updates
and special pricing
Get early access to new features and exclusive discounts delivered straight to your inbox