Skip to Content

Devin Clark

Magistrate

Magistrate is a product I am building. It's a dashboard that helps find and fix issues with your app's Postgres database. It also helps improve database performance.

Technology #

Magistrate's front-end is a Preact.js SPA. We have server framework plugins in Express.js, Hapi.js, and Rails that serve up the dashboard and an API for the dashboard to understand the database. The API runs our queries to understand the database. Rob Sullivan is the brains behind the database queries we run and what the data returned means.

Implementation #

Building the application as a server framework plugin makes integration super easy for customers because it doesn't require any additional infrastructure. Integrating the Hapi.js plugin into your existing application can be as simple as adding this code before starting the Hapi server.

await server.register({
plugin: require('magistrate/hapi'),
options: {
credentials: {
connectionString: process.env.DATABASE_URL,
},
provider: 'heroku',
},
});

The other frameworks are roughly as much work to implement.

Functionality #

Slow Queries #

Magistrate slow queries table

We pull the top slowest queries and sort them by the highest impact queries to fix.

Bloat #

Magistrate bloat screen

We analyze table and index bloat and provide the queries to fix the bloat in a variety of different ways depending on Postgres version and installed extensions.

Extensions #

Magistrate installed extensions

We show installed (and available) Postgres extensions, their versions, and if the version is up to date.

There's a live demo available that shows how snappy the dashboard application is, despite being a Single Page Application. More information about the product features and purchasing is available on the Magistrate Website.

Photo of Devin Clark
Devin Clark
Principal Software Engineer, Oracle