Explore the core differences between sharding and layer 2 solutions, covering how they work, performance, security, costs, and ideal use cases for blockchain scaling.