If you want to implement those, look into DSLabs.
It's an open source Distributed Programming simulator and model checker with various labs of increasing difficulties. The second to last lab is implementing Paxos (can also do Raft), while the last lab is a sharded KV store system (~ Google Spanner).
It's in Java and can be run on a single machine.