Community SQL: Query your community like it's PostgreSQL
If you're building a developer focused community, there's a high chance it lives on Discourse. Let's level up your community metrics game with some SQL flavour.
Step Backwards
If you’re in the devtools space, you don’t need to place big bets to guess what most other community folks are using to host their developer hubs. The choices are plenty, but in reality, it almost always comes down to three:
Discord
Slack
Discourse
When it comes to analytics though, the part where you actually want to understand community health, engagement depth, and whether what you’re building is a win-win for developers and your org, the options start to narrow. Especially if you’ve got a clear idea of what you’d like to measure and how the platform lets you do it.
In this one, we’ll focus on Discourse. In the coming weeks, we’ll tackle Discord and Slack, so if you’re into that, hit the subscribe button (as every YouTuber loves to say).
Discourse Numbers Landscape
Are you a community engineer? Or maybe a developer community lead?
Whatever your title is, if you’re running your community on Discourse as your community platform, like OpenAI, MongoDB, Cursor, Cloudflare and many others, and at the same time you are on their Business or Enterprise tier, you have two analytics options.
You can stick with the built-in dashboard, which does a solid job of surfacing high-level essentials. Or, if you’re more of an SQL geek (guilty), you can dive into the Data Explorer plugin for more control.
Now, you might ask: wait, isn’t the dashboard already giving me everything I need?
It depends. The dashboard gives you a solid snapshot of your core health metrics, but with time and experience, you’ll want deeper analytics that help you understand the context behind those numbers.
What is Discourse Data Explorer bro?
It is basically a Discourse plugin for running SQL queries against your database, allowing for instant stats reporting. Those queries can be triggered manually via admin dashboard by your platform admin, or you can even build an automation and run a set of queries through an API from an external app. You basically turn on the plugin through your admin plugins page and then you can start creating them from scratch in the built-in editor or import from a json file. Just like that:
Queries, queries everywhere
So what should you measure? It’s up to you but it’s good to have some starting points, right?
Beware of anyone trying to pitch, or worse, sell you the ultimate set of metrics every community should track. That doesn’t exist.
If you’re new to the field, you’ll probably start with a few numbers that are widely adopted and shared publicly by others. That’s perfectly fine. Over time, as you learn more about your community and your business, you’ll figure out which metrics actually matter.
You might still be wondering though, so what can I measure? Here are just a few examples:
Number of topics that have been replied to
List users engaging mostly in DMs instead of public threads
Get number of new users by month
There’s no shortage of metrics you can explore. The database schema (and maybe your imagination) are the only real limits.
Alright, I know I broke one of the core DX rules and didn’t share any copy-ready snippets. Let’s fix that with one last goodie.
Community SQL Public Repo
That’s right, you guessed it!
I’ve put together a public repo with a set of queries you can run right away.
It’s a mix of community-focused metrics around activation, and retention, divided into three groups:
High Level: overall view on community health and where it’s heading
Member Specific: analyzing specific users’ behavior to help you build relationships
Admin: speeding up your effective query creation and cleanup and
Here’s a little sneak peek of what to expect:
What’s Next
The repo is public. Browse it, test it, break it (just make sure to go through Code of Conduct and Contributing first). I’ve also added issue and PR templates, so you can easily report bugs or extend the set of queries with your own ideas and share them with the community.
As for this newsletter, as I mentioned above, in the coming weeks we’ll dive into the metrics landscape for Discord and Slack.
(I know, I originally planned just Discourse and Discord… but hey, plans change. Lucky you!)
Huge thanks to Jim Morrison and Dan Woda for the input to this one 🙏
Have an awesome week, everyone! 🤜🏻 🤛🏽











I resonate with this. What about AI integraton? Very insightful, thanks!