Central Dogma - Highly-available version-controlled service configuration repository
This session introduces Central Dogma's multi-master architecture and disaster recovery strategy. Additionally, the core features of Central Dogma are briefly introduced.
aims to ensure an agreed level of operational performance, usually uptime, for a higher than normal period. https://en.wikipedia.org/wiki/High_availability
Master 4 replication replication replication replication • All nodes in Central Dogma cluster are master. • Clients can write data to any nodes. • Clients can read data from any nodes. replication write/read write/read write/read
Master 2 Master 3 Master 4 replication replication replication Even if a master node breaks down, clients continue to read and write operations with zero downtime. replication write/read write/read write/read
all other master nodes. • What if the same file is updated on different servers at the same time with different contents? replication Challenging issues in multi-master Master 1 Master 2 💻 A’ write A → A’ A A → A’ replication Master 1 Master 2 💻 B write A → B C A → C 💻 write A → C A → B Master 3 A → A’ replication A conflict 💥 consensus algorithm
server for distributed coordination. • Apache Curator provides a variety of recipes on the top of ZooKeeper which Central Dogma needs. • ZooKeeper is a server, so we have to build a separate cluster. • However, external components could be another single point of failure. • Central Dogma should guarantee high availability.
ZooKeeper Store replication logs to znode of ZooKeeper Central Dogma Embedded ZooKeeper Central Dogma Embedded ZooKeeper Read new replication logs from ZooKeeper and apply the logs to the old data replication replication Synchronize new changes with ZooKeeper Local storage Local storage
concurrent modification. Distributed locks Master 1 write A → B write A → C A → B 1. Acquire a lock for A and update A to B Curator distributed locks Master 1 Curator distributed locks replication 2. Wait to acquire a lock for A 3. Abort the late request due to conflict. return an error 💥 https://curator.apache.org/curator-recipes/shared-reentrant-lock.html
Writes will stop when the majority of replicas are stopped. • An entire cluster in a data center could break down. Master 5 Master 1 Master 2 Master 3 Master 4 replication replication replication replication replication
dogma.forRepo("my_project", "my_repository"); Watcher<JsonNode> watcher = repo.watcher(Query.ofJsonPath("settings.json", "$.foo")) .start(); watcher.watch((revision, json) -> { // 👈👈👈 System.out.println("Foo has been updated to " + json + " at revision " + revision); }); Clients get notified on a new commit. https://line.github.io/centraldogma/client-java.html
• Four roles ◦ Administrator, Owner, Member, Guest • In a repository, read and write permission can be set based on: ◦ Roles, users and tokens • Application token ◦ Represents a virtual user
in a GitHub / GitLab repository • Send a pull request to modify the configuration • Get it reviewed and merged • Let your services read from Central Dogma ◦ Queryable ◦ Watchable ◦ Highly-available ◦ Accessible from the same network