How parth3105/dosv works
Main Components
• Client Program:
• Contains the user-facing client interface (Client.java).
• Includes task handling modules (DownloadHandler, UploadHandler, RequestHandler, TaskHandler) for handling file operations.
• Load Balancer Program:
• A dedicated component (LoadBalancer.java) that manages incoming requests and distributes load, potentially to multiple meta servers.
• Meta Server Program:
• Acts as the central coordinator for metadata management.
• Communicates directly with a PostgreSQL database (see lib/postgresql-42.7.5.jar used here) for persistent meta information.
• Contains key modules such as DAO (MetaDAO), service layer (MetaService), configuration for database connections, and even a distribution module implementing consistent hashing to balance meta information.
• Also handles task events with its DownloadHandler, UploadHandler, and TaskHandler.
• Storage Server Program:
• Manages the actual file or object storage backend.
• Uses SQLite (sqlite-jdbc jar provided) for local data persistence.
• Features its own service and DAO layers to interact with stored objects.
Relationships and Interactions
• The Client sends requests (upload/download/other file operations) to the Load Balancer.
• The Load Balancer forwards these requests to the appropriate Meta Server.
• The Meta Server acts as the orchestrator; it:
• Communicates with the PostgreSQL backend for metadata operations.
• Uses consistent hashing (as seen in ConsistentHashing.java) to determine which Storage Node to interact with.
• Manages flow both internally (between modules such as request handling and service logic) and externally (across multiple meta servers and with storage nodes).
• Following decision-making by the Meta Server, the Storage Server receives event-triggered interactions (data storage, retrieval, etc.) and uses its built-in SQLite for local persistence.
• There’s a bi-directional flow since Storage Servers might need to return data or confirmations back to Meta Servers, which then relay responses back through the Load Balancer to the Client.
Architectural Patterns and Design Principles
• Separation of Concerns – Each component (client, load balancer, meta server, storage server) encapsulates its responsibilities.
• Modular Design – The presence of task handlers, service layers, and DAO layers indicate that the code base is decomposed into well-separated modules.
• Distributed System Concepts – Use of consistent hashing for distributing load and multiple instances of Meta Servers.
• Event-driven Communication – As per the additional instructions, internal flows within Meta Servers and Storage Nodes are managed along with each other when events occur.
Incorporating the Multiple Meta Server and Storage Node Interaction
• Clearly denote that multiple Meta Servers exist; illustrate them either as several parallel components or as a cluster.
• That each Meta Server communicates not only with its dedicated PostgreSQL but also with a group of Storage Nodes. Use a “cloud” symbol or grouping for Storage Servers to indicate redundancy and distributed nature.
Final Touches
• Remember to include any relevant build and configuration aspects only if they impact the runtime inter-component interactions (for instance, highlighting the use of jar libraries for database connectors which may affect infrastructure setup).