A guide to building stateful distributed systems