Built with .NET Core & gRPC
This project simulates a distributed calculator system using gRPC services in .NET Core. It demonstrates key distributed systems concepts such as vector clocks, rollback, eventual consistency, and CAP theorem trade-offs.
DistributedCalculator/
├── CalculatorClient/ # gRPC client with vector clock logic
├── GrpcServer1/
├── GrpcServer2/
├── GrpcServer3/
├── Shared/ # Shared VectorClock class and models
└── README.md # This file
- ✅ gRPC-based calculator with Square, Cube, and SlowMultiply operations
- ✅ Vector Clock tracking for causality
- ✅ Rollback mechanism on simulated errors
- ✅ CAP theorem simulation: prioritizes Availability + Partition Tolerance
- ✅ Eventual consistency with delayed clock sync
- ✅ Leader election (simulated)
- ✅ Two-phase commit for multi-server operations
- .NET Core 8
- gRPC
- C#
- GitHub Actions (optional CI/CD)
- Client sends a number and operation to selected server
- Server merges vector clock, simulates delay, and may fail randomly
- On failure → rollback and return
isSuccess = false
- Client retries with previous clock
- Vector clocks evolve and log causal relationships
- Consistency: relaxed (vector clocks allow divergence)
- Availability: prioritized (client always gets a response)
- Partition Tolerance: supported (servers operate independently)
- Understand vector clocks vs Lamport clocks
- Implement rollback and compensation logic
- Simulate distributed failures and recovery
- Explore consistency models and trade-off
Chamod –