Video in progress
What is a single point of failure? Give an example from a simple web application.
A single point of failure is a part of the system whose failure stops the whole system. A database on a single server, a single load balancer, a single DNS provider, or a password only one person knows are all examples.
📖 Answer
A typical small project: Nginx, a Spring Boot application and PostgreSQL on one VPS. Here everything is a single point of failure — if the server goes down, everything goes down.
Fixing it step by step:
- Run 2+ copies of the application and put a load balancer in front.
- Add a replica to the database and set up automatic failover.
- Make the load balancer a pair too, or take a managed balancer.
- Place the servers in different availability zones.
There are also places people forget:
- the TLS certificate is renewed by hand and expires;
- a cron job runs on only one server, and if that server goes down, no reports go out;
- the backup sits on the same disk as the database.
Removing every SPOF costs money. In an interview you don't have to remove them all, but you should be able to say which ones remain and why.
Sign up to mark studied questions and save your progress.