The one book I recommend to every backend engineer. It builds up from the storage engine to replication, partitioning, and consensus, and by the end the tradeoffs behind every distributed system click into place.
Designing Data-Intensive Applications
Martin Kleppmann