Distributed Web infrastructure

Why Adding More Components:

  • Each new component serves a specific purpose to make our system work better or handle more users.
  • More elements can improve reliability, performance, and scalability.

Load Balancer Distribution Algorithm:

  • A load balancer is like a traffic cop for our website, directing requests to different servers.
  • It uses a distribution algorithm to decide how to send requests.
  • Common algorithms include Round Robin (sending requests in order), Least Connections (to the least busy server), and IP Hash (using client IP).

Active-Active vs. Active-Passive:

  • Active-Active means both servers are actively working, sharing the load. If one fails, the other takes over.
  • Active-Passive has one active server and one standby. If the active one fails, the standby kicks in.

Primary-Replica (Master-Slave) Cluster:

  • It’s like having a boss (primary) and an assistant (replica) for our database.
  • Primary node receives all the updates, and the replica copies everything to stay in sync.

Difference between Primary and Replica:

  • Primary handles data changes (writes), while the Replica only reads data.
  • For the application, the Primary is like the editor, and the Replica is the reader.

Issues with the Infrastructure:

Single Point of Failure (SPOF):

  • SPOF is where if one part fails, the whole system stops working.
  • In this setup, if the load balancer or primary database goes down, the entire system is at risk.

Security Issues:

  • No firewall means there’s no barrier to protect our system from unauthorized access.
  • No HTTPS means data sent between users and the system is not encrypted, risking data interception.

No Monitoring:

  • Without monitoring tools, we can’t keep an eye on how our infrastructure is doing.
  • We won’t know if a component fails or if there are performance issues until it’s too late.

Leave a Comment