How Distributed Database Works