How ricomateo/tp0 works
Main Components to Highlight
• Client Container(s): Represent the Golang-based client(s) (located under the “client” directory) which are responsible for generating and sending messages (or bets in later exercises). Note that there may be multiple client instances (for example, client1, client2, …) as generated by the “generar-compose.sh” script.
• Server Container: Represent the Python-based server (located under the “server” directory) that listens for incoming connections, processes messages (echo or lottery-related bets), and coordinates concurrency aspects such as parallel processing and synchronization.
• Shared Volumes/Configuration Files: Show that configuration files (config.yaml for the client and config.ini for the server) are externally mounted into the containers via Docker volumes for dynamic configuration updates without rebuilding images.
• Data Sources: Include a reference to the .data directory (containing dataset.zip, which has the agency files for bets) being injected via volumes into the client containers.
Relationships and Interactions
• Flow: clients initiate a connection to the server, send messages or batches of bets, wait for and process the server’s echo or bet processing confirmation, and optionally follow-up with additional actions (like winner queries).
• Routing of configuration updates via external volumes.
• Docker Compose orchestration which sets up containers, networks, and shared resources (volumes, networks).
Architectural Patterns and Design Principles
• Separation of Concerns: Emphasize the distinct roles of the client and server.
• Containerization: Clearly highlight that both applications run within Docker containers, with images built per language (Golang for the client and Python for the server).
• Microservices Elements: Even though the system is composed of two main services, the Docker Compose file manages multiple instances (especially multiple clients) suggesting a microservice-like approach regarding scaling and isolation.
• Concurrency & Synchronization: On the server side, detail the use of multiprocessing (spawned processes, use of locks and barriers) for handling concurrent client interactions.
Relevant Technologies, Frameworks, and Libraries
• Golang: For the client application.
• Python: For the server application.
• Docker & Docker Compose: For containerization and environment management.
• Makefile: For controlling operations (building images, scaling containers, etc.).
• Multiprocessing in Python: For parallel processing and synchronization primitives (locks and barriers).
• Docker Volumes: For in-container configuration and the usage of external datasets.