π Distributed Systems Lab β Detailed Breakdown #
This lab is structured as a step-by-step journey through the lifecycle of building a distributed system with microservices.
π Phase 1: Monolithic Smart Library System #
We begin with a monolithic design, where all components of the system reside in a single codebase.
Youβll Learn:
- How to structure a monolithic application
- Why monoliths become difficult to scale and maintain
- Building core modules: Users, Catalog, Borrowing
- Separation of concerns: Controller β Service β Repository layers
π§© Phase 2: Transition to Microservices #
Next, we break down the monolith into independently deployable microservices.
Youβll Learn:
- How to decompose services by business capability
- RESTful API communication between services
- Managing independent data sources
- Principles of loose coupling and bounded context
π Phase 3: Reverse Proxy with Nginx #
We introduce Nginx to centralize and manage access to microservices.
Youβll Learn:
- How reverse proxies work
- Nginx configuration for routing and load balancing
- Handling HTTPS and static files with Nginx
- Benefits of centralized access control and logging
π³ Phase 4: Containerization with Docker #
Now we containerize each service to ensure consistency across environments.
Youβll Learn:
- Writing Dockerfiles for services
- Managing containers, images, and networks
- Creating isolated environments for each service
βοΈ Phase 5: Managing with Docker Compose #
With more services, orchestration becomes important. Enter Docker Compose.
Youβll Learn:
- Defining multi-service environments in
docker-compose.yml
- Networking between services
- Simplifying development and testing
π’ Phase 6: Orchestration with Docker Swarm (Optional) #
For real-world scalability, we use Docker Swarm to orchestrate services across a cluster.
Youβll Learn:
- Setting up a Swarm cluster
- Deploying services in a distributed fashion
- Achieving high availability and self-healing systems
π§ Group Presentation on System Design #
In this collaborative exercise, teams will tackle real-world system design challenges that scale from hundreds to millions of users. Each team will:
- Select a Scalable Project: Choose from industry-relevant scenarios like social media timelines, URL shorteners, or distributed search engines
- Create a Multi-Stage Scaling Plan: Design architecture that evolves through three growth stages (1K β 100K β 1M+ users)
- Specify Technical Components: Detail infrastructure, databases, caching strategies, API design, and monitoring solutions
- Present with Diagrams: Deliver a comprehensive presentation with architecture diagrams, justifications for design choices, and analysis of potential failure points
Teams will be evaluated on their application of distributed systems principles, scalability considerations, and technical communication skills.
π Group Presentation on Industry Trendy Distributed Systems #
Teams will deeply explore modern distributed technologies that power today’s scalable applications. For this presentation:
- Research & Analyze: Thoroughly investigate an assigned distributed system technology (e.g., Cassandra, Kafka, Redis Cluster, Etcd, Consul, CockroachDB, or MinIO)
- Document Key Aspects:
- Architecture: Core components and structural design
- Working Principles: Algorithms and data flow mechanisms
- High Availability: Failure handling and redundancy approaches
- Use Cases: Optimal application scenarios and problem domains
- Integration: How it fits within microservices ecosystems
- Deliver Engaging Presentation: Share insights with peers and faculty, emphasizing practical applications
Presentations should reinforce understanding of consistency models, consensus protocols, data partitioning, and state management in distributed systems.
π Final Outcome #
By the end of this lab, you will have:
- Built and deployed a functional microservices application
- Practiced containerization and orchestration
- Understood the real-world workflow of backend and DevOps engineering
- Strengthened your system design thinking
Ready to build your first distributed system? Letβs dive in! π