Is your SaaS ready for a second server? A 10-point check

Ten questions that show whether your app can run on two servers behind a load balancer, or whether it quietly depends on one machine.

The short answer

Your SaaS is ready for a second server if no copy of the app keeps important data on its own disk or in its own memory, scheduled jobs are safe when two copies run, migrations work with old and new versions at once, and every copy has a health check. If any of the ten checks below fails, it will break the day you add a server.

On this page
  1. 1. Do uploads and generated files live outside the app server?
  2. 2. Is all important data in a database server, not a file on disk?
  3. 3. Are sessions stored somewhere both servers can read?
  4. 4. Do rate limits and login lockouts live in shared storage?
  5. 5. Are scheduled jobs safe with two copies running?
  6. 6. Are idempotency keys and other “have I seen this?” records shared?
  7. 7. Do migrations work with the old and new versions at the same time?
  8. 8. Does configuration come only from the environment?
  9. 9. Does every copy have a health check?
  10. 10. Can you deploy without dropping requests?
  11. How do you score it?
  12. Do you actually need a second server?
  13. What is the most common mistake?
  14. Working with us

Most SaaS products start on one server. That is fine. The risk is that the code slowly starts to depend on that one machine, and you find out on the day you need a second one: after an outage, a traffic spike or a security review that asks about redundancy.

Here are ten checks. Answer each with yes or no. Each “no” is something to fix before you add the server, not during an emergency.

1. Do uploads and generated files live outside the app server?

If the app writes files into a folder next to the code, a second server will not see them. Files belong in S3-compatible object storage, accessed only through the S3 API. Then moving between providers is a configuration change.

2. Is all important data in a database server, not a file on disk?

An embedded database file (such as SQLite) sits on one machine. Two servers would mean two different databases. Move to PostgreSQL or another network database first. We did exactly this on a live CRM and wrote it up in our SQLite to PostgreSQL switch.

3. Are sessions stored somewhere both servers can read?

Sessions held in process memory sign people out when a load balancer sends them to the other server. Keep sessions in the database, or in Redis if you already run it, or use signed tokens that carry what the server needs.

4. Do rate limits and login lockouts live in shared storage?

A limit kept in memory is one limit per server. Two servers means attackers get twice the attempts. Count in a shared store. A good test: fire many requests at once at a limit of 10 and check that exactly 10 get through, however many copies are running.

5. Are scheduled jobs safe with two copies running?

This is the check that is easiest to fail without noticing. A timer inside the web process sends every reminder email twice on two servers. Use a job queue with singleton schedules (pg-boss on PostgreSQL, or BullMQ job schedulers on Redis), or wrap each run in a PostgreSQL advisory lock and skip the run if another copy holds it.

Also look at jobs that read then write: two workers should never pick up the same row. Row locking with SKIP LOCKED is the usual tool.

6. Are idempotency keys and other “have I seen this?” records shared?

Payment webhooks, imports and API retries often use a record of what has been processed. If that record is in memory, the second server will process the same event again. Store it in the database with a unique constraint.

7. Do migrations work with the old and new versions at the same time?

During any deploy, old and new code run against one database for a short time. So changes must be expand and contract: add the new column, backfill, switch reads, and drop the old column in a later release. A migration that renames a column breaks the running version the moment it executes.

8. Does configuration come only from the environment?

If a server has a hand-edited config file, the second server will differ from the first. All configuration should come from environment variables, and the same image should run everywhere. Build the image in CI, tag it with the commit, and pull it on the server. Never build on the server.

9. Does every copy have a health check?

A load balancer can only route around a broken copy if it can tell that the copy is broken. HTTP services need a ready endpoint that checks the database. Background workers need a heartbeat. We describe how we watch these from outside in uptime checks outside the server.

10. Can you deploy without dropping requests?

With two servers you can take one out while you update it. Even on one server, you can start the new container, wait for its health check, then switch. Without health checks and without a proxy that retries briefly, every deploy is a small outage. See our zero-downtime deploys.

How do you score it?

Yes answers What it means
9 or 10 Add the server. Test it with a staging pair first.
6 to 8 Fix the “no” items in the order of the list, which roughly matches how often each one bites.
Under 6 Treat it as a project. A second server added now would make things worse, not better.

Do you actually need a second server?

Not always. One well-run server with tested backups and fast restores is enough for many products. The reason to follow these rules early is that they cost little on one server and a lot to retrofit. We wrote the full set of rules we follow in designing a SaaS that can move servers.

What is the most common mistake?

Adding the second server first and discovering the problems from customers. Two copies of the app can expose a hidden dependency in minutes: duplicate emails, people signed out at random, files that exist on only one machine. Test with a staging pair before production, and watch for these three symptoms: the same job running twice, sessions disappearing, and uploads that cannot be found. Each one maps to a check above. A second server also needs a way to send traffic to a healthy copy, which is why checks 9 and 10 matter even before you buy the hardware.

Working with us

If your app fails several of these checks, we can look at it with you and put the fixes in order of risk, then make them without stopping the product. Tell us what you run today via contact, or see how we approach SaaS platforms.

Keep reading

Tell us what you want to build.

A product, a website, a search problem or a system that should work better. We reply with a plain answer and the first step.

A few sentences are enough (at least 20 characters).

We use your details only to answer your inquiry. See our privacy policy.