How sadham-hussian/distributedparallelwebserver works
• A load balancer (implemented in Go) that acts as the entry point for incoming HTTP requests.
• A web server (implemented in Java) that handles and processes these requests.
Main Components Identification
a. Load Balancer:
– Located in the “load_balancer” directory.
– Contains a main Go file (main.go) along with its module definitions (go.mod), indicating it is a standalone service.
– Acts as the gateway that receives incoming client requests and directs them to backend servers.
b. Web Server:
– Located in the “webserver” directory, with its source code in “webserver/src”.
– Contains Java files (Connection.java, HTTPRequest.java, HTTPResponse.java, WebServer.java) which define how the HTTP transactions are managed.
– Includes a Dockerfile, implying the server can be containerized for easier deployment and scalability.
– Likely allows for multiple instances given the “DistributedParallelWebServer” concept.
Interactions and Data Flow
a. Client Request Flow:
– External clients send HTTP requests to the load balancer.
b. Request Routing:
– The load balancer receives the request and, based on its internal logic, distributes them across one or more web server instances.
c. Web Server Processing:
– The web servers process the HTTP requests, manage connections, and generate HTTP responses that are sent back through the load balancer to the client.
Architectural Patterns & Design Principles
a. Separation of Concerns:
– The design clearly distinguishes between the entry-point (load balancing) and the backend processing (web server).
b. Parallel/Distributed Processing:
– This design enables multiple web server instances to operate in parallel and distribute load, improving performance and scalability.
c. Containerization:
– The presence of a Dockerfile in the web server suggests containerized deployment, which can simplify orchestration in distributed environments.