Citus 10.2 is out! 10.2 brings you new columnar & time series features—and is ready to support Postgres 14. Read the new Citus 10.2 blog.

Skip navigation

Citus Data internal hackathon roundup

Written by Craig Kerstiens
March 26, 2018

At Citus Data, we regularly get the team together, because even with an engineering team that is distributed around the globe, face-to-face time is valuable to connecting and collaborating. During our team offsites, we often organize engineering hackathons to proof out new ideas, learn new things, or just for fun. We recently completed one of our Citus hackathons and thought we’d share some of what we built.

The theme of our hackathon this time was on building the ultimate dashboard for our Citus extension to Postgres. For Postgres, there are lots of options out there for capturing and displaying insights into your database. You could use New Relic, Vivid Cortex, or something entirely open source like pghero. But we wanted to explore the question, what more could we provide?

Our two teams took two very different approaches, but each emerged with something interesting that we hope to continue to build on and productize in the future. In case you’re curious, here’s a look at each of the projects from our hackday:

Pg_stat_statements for your tenants

Pgstatstatements is one of the most powerful tools you as an application developer have in tuning and improving the performance of your application. If you are unfamiliar, pg_stat_statements records every query that is run against your database, parameterizes it, and then maintains various stats about the query over time.

Two of the most valuable bits of information are how much time the query has taken to run and how many times it has been run.

In knowing how great pg_stat_statements already was, one team dug in to see if there was more value we could layer on. What emerged was Landlord. Landlord builds on pg_stat_statements to provide per tenant stats. Want to know which customer is running the most queries between 8am and 9am, you can now get that insight. Want to know which customer has the longest running queries, now you can. Landlord is a powerful extension of pg_stat_statements that records all of the queries run but retains which customers were running which queries. Have tenants that are causing issues, let landlord take care of it for you.

Your new dashboard: CitusHero

We believe in open source—side-note for those new to Citus, our Citus extension to Postgres is also open source—and we already have a lot of customers leveraging pghero with Citus. So we thought it would be great to create a Citus version of pghero that anyone could install with the click of a button. The other project from our hackday: CitusHero, a Citus specific version of pghero, which you can yourself deploy with a single click to Heroku:

Deploy

Hopefully you’re already familiar with pghero as it’s a great tool for insights to your database. If you’re not familiar with it, at a high level pghero provides:

  • Query Details about expensive queries
  • Insight into storage
  • Key statistics around vacuum and analyze

With CitusHero, we’ve now enhanced pghero to include all new information that is useful for anyone running Citus. Let’s take a deeper look at what’s new:

Citus specific tables

In CitusHero, you still get all the insights you loved about table sizes and whether indexes were used or unused which is helpful in managing your database, but you also get more specific info into whether tables are distributed tables, reference tables, or standard tables.

How are those tenants doing?

Because so many SaaS businesses look to Citus to help scale their multi-tenant applications, we felt it would be valuable to give you a dashboard just around your tenants (or users, or customers.) With this dashboard, you can now get an instant look at your tenants and know if you have a tenant that merits running tenant isolation on

The future of Landlord and CitusHero

With our Citus developer team hackathons, our goal isn’t to have just another day of coding and database work, but rather improve our ability to work together as a team. For each team, this exercise allowed us to work together on areas we can improve on and build rapport at the same time. It was refreshing and exhilarating that in the span of a single day, we were able to go from abstract problem space to something that shows promise, to create something that can add concrete value.

At this stage, we’d caution that both Landlord and CitusHero are very much prototype stage and alpha quality. The results from each are promising and our product and engineering teams see an opportunity to bring them fully to production grade in the future. With any luck, you see future announcements on each of these from us. In the meantime, feedback welcome!

Craig Kerstiens

Written by Craig Kerstiens

Former Head of Cloud at Citus Data. Ran product at Heroku Postgres. Countless conference talks on Postgres & Citus. Loves bbq and football.