Distributed Systems in Java - 30-Day Learning Plan
Day 1: Introduction to Distributed Systems
Theory: Definition, characteristics, pros and cons, types of distributed systems.
Practice: Build a simulation of 3 interconnected Java nodes using threads and TCP sockets.
Day 2: Network Communication Basics
Theory: TCP, UDP, HTTP, message serialization (JSON, XML), and protocols.
Practice: Java sockets - implement a client-server communication system using TCP.
Day 3: Remote Procedure Call (RPC)
Theory: What is RPC, how it works, pros/cons, and how Java RMI works.
Practice: Build a simple calculator using Java RMI.
Day 4: Message Passing Systems
Theory: Synchronous vs asynchronous communication, message queues.
Practice: Use Java with RabbitMQ or ActiveMQ to build a message-driven app.
Day 5: Serialization and Deserialization
Theory: Object serialization, JSON, XML, protocol buffers.
Practice: Serialize Java objects to JSON using Jackson or Gson and send over a socket.
Day 6: Time and Clocks in Distributed Systems
Theory: Clock skew, NTP, Lamport timestamps, Vector clocks.
Practice: Implement Lamport timestamps in a multi-threaded simulation.
Day 7: Threading and Concurrency Basics in Java
Theory: Threads, race conditions, synchronization.
Practice: Simulate multiple clients interacting with a shared server using threads.
Day 8: Distributed Consensus (Paxos and Raft Overview)
Theory: Why consensus is hard; Paxos vs Raft overview.
Practice: Simulate leader election using random delay and election messages.
Day 9: Leader Election
Theory: Bully algorithm, Ring algorithm.
Practice: Implement the Bully Algorithm in Java using sockets.
Day 10: Distributed Mutual Exclusion
Theory: Ricart-Agrawala algorithm, Token ring.
Practice: Implement the Ricart-Agrawala algorithm in Java.
Day 11: Heartbeats and Node Failure Detection
Theory: How to detect dead nodes; heartbeat mechanisms.
Practice: Implement heartbeats using scheduled messages; detect node failures.
Day 12: Gossip Protocols
Theory: Epidemic protocols, anti-entropy.
Practice: Build a gossip-based member discovery system.
Day 13: CAP Theorem
Theory: Consistency, Availability, Partition Tolerance - tradeoffs.
Practice: Simulate scenarios where one of CAP must be sacrificed.
Day 14: Eventual Consistency
Theory: Strong vs eventual consistency, CRDTs.
Practice: Simulate eventual consistency using delayed message updates.
Day 15: Distributed File Systems (DFS)
Theory: HDFS architecture, chunking, replication.
Practice: Simulate a basic DFS in Java with file chunking and replication.
Day 16: Replication Techniques
Theory: Active vs passive replication, primary-backup.
Practice: Implement a primary-backup system using Java sockets.
Day 17: Sharding and Partitioning
Theory: Horizontal partitioning, consistent hashing.
Practice: Simulate data sharding across nodes using a hash-based approach.
Day 18: Distributed Caching
Theory: Cache invalidation, write-through, write-back.
Practice: Build a basic distributed cache using Java and sockets.
Day 19: Transactions and Two-Phase Commit
Theory: ACID, distributed transactions, 2PC protocol.
Practice: Implement a basic 2PC coordinator and participants in Java.
Day 20: Quorum Systems
Theory: Majority-based decision making, read/write quorums.
Practice: Simulate quorum-based read/write in Java.
Day 21: Vector Clocks
Theory: Causality, version vectors, conflict resolution.
Practice: Implement vector clocks and simulate message ordering.
Day 22: Load Balancing Techniques
Theory: Round-robin, least connections, consistent hashing.
Practice: Create a Java-based round-robin load balancer.
Day 23: Fault Tolerance and Redundancy
Theory: Failover, retries, replication.
Practice: Simulate a service that fails and recovers, using backup instances.
Day 24: Distributed Logging and Monitoring
Theory: Centralized logging, log collection challenges.
Practice: Use Log4j and build a centralized log collector in Java.
Day 25: Security in Distributed Systems
Theory: TLS, authentication, authorization, MITM, replay attacks.
Practice: Use Java's SSL/TLS and implement secure communication between nodes.
Day 26: Service Discovery
Theory: Static vs dynamic discovery, service registries.
Practice: Simulate a simple registry and service lookup mechanism in Java.
Day 27: Microservices Architecture
Theory: Microservices vs monolith, communication, data management.
Practice: Build 2 microservices in Java and communicate via HTTP (using Spring Boot or plain
Java).
Day 28: Containerization and Deployment (Intro to Docker)
Theory: Why containers, Docker basics, orchestration.
Practice: Containerize your Java services using Docker.
Day 29: Design a Real-World Distributed System
Theory: Design process, architecture decisions, trade-offs.
Practice: Design a distributed chat system or file-sharing app architecture in a document.
Day 30: Build a Mini Distributed System
Practice-only: Build a distributed key-value store in Java, using:
- Leader election
- Replication
- Heartbeats
- Eventual consistency