Deep dive into implementing scalability patterns including CQRS, event sourcing, and sharding strategies in distributed systems