All nodes running
Nodes in Texas and London down
We were amazed by what CockroachDB had to offer -- a distributed, scalable and resilient SQL Database that _ just works _. However, we wanted to further enrich the experience of using CockroachDB, and so set out to build an augmented cluster management tool.
What it does
CockroachNest monitors a CockroachDB cluster and displays important statistics and information in an intuitive way. The node locations are overlaid on a map, along with their health, uptime, latency and other key pieces of data. A more detailed view allows the DB Admin to further inspect the cluster.
How we built it
We used PHP to collect, aggregate and process the raw data and exposed it to the client-side using different endpoints. We used Angular 4 for the front-end, which polled on the endpoints to display the information in real time. We also set up a smart notification system using PagerDuty.
We also created a micro-service using Node.js that is deployed to each node, allowing the DB Admin to centrally control all the nodes.
To replicate a real production instance of CockroachDB, we launched 8 instance of a VPS that were geographically spread out and launched CockroachDB nodes on them.
Challenges we ran into
Our biggest challenge was the front-end; getting all the different pieces to work seamlessly and finding intuitive ways to display and visualize data in a feasible way was challenging. We also hit a lot of technical challenges on the client-side, getting the components to work as they should.
On the server-side, we had to really optimize the code to eliminate any overhead. Each response gave information for all the nodes, which meant that we had to account for the latency due to the geographically dispersed nodes.
Accomplishments that we're proud of
We're proud of doing something that hasn't been done before for CockroachDB -- both on the counts of creating a unique management tool for CockroachDB and creating a PagerDuty integration. However, most importantly, we are proud to have made something that can actually be used in production.
We got to work with what we think is one of the coolest and most exciting technologies, and we were able to integrate them together to make something useful.
What we learned
We learned how to set up a distributed database, how to integrate it with an application and manage it. We also gained experience with more complex front-end design.
What's next for CockroachNest
Since CockroachNest is already function, the next step is to add even more features. We would like to have a tab where we can take a closer look at the Database as a whole, and carry out WHERE clauses.