How to not gatekeep the database (safely)
Mali Akmanalp
mali+percona@akmanalp.com
Who am I?
HubSpot SQL infra today
What this talk is about
What it is NOT about
What we’ll cover
Prelude:
Where we started
The olden times
First, getting the basics under control
As old issues went away, new ones replaced them …
Have you ever noticed this:
Chillest oncall ever…
==�Company week off
(A curious connection?)
Observation:
Majority of critsits now were related to usage
Commonalities: not infra failures
A new class of problems relating to usage
“Bad query” that wreaks havoc
Unexplained timeouts / circuit breakers
Jobs / workers backlogged
Slow, trickling growth and then sudden disaster
Ungated feature takes database down
One way to react to this:�“I’m the captain now”
… but this was a no-go from the start
What didn’t work:
“not our problem”
Who owns this problem?
Database Team
Expertise in finding root-cause workload / query
Doesn’t have product context
Product Team
Expertise in the product they’re building
Trouble finding problematic needle in haystack of queries
Trouble monitoring lurking issues
Shared responsibility!
Unclear boundaries!
“Not our problem”: Postmortem
What kinda worked:
“Best practices”
”RTFM”
“Best practices” / RTFM
“Best practices” works best if …
Documentation: postmortem
Internal tech talks
Internal tech talks: postmortem
Linting, but intentionally
What didn’t work:
white glove service
White glove service
White glove service: Postmortem
What did work:
Isolation
Isolation
What did work:
Tooling
A brief tour of developer experience today
Cluster Health Dashboard
Interlude: non-classic metrics I really like
What did work:
Libraries & standardization
Libraries & standardization
Libraries & standardization: Queries
Libraries & standardization: Migrations
migrations.sql:
Libraries & standardization: Demo
How does all this help infra?
What did work:
Mass fixes
Mass fixes
Mass fixes: JDBI upgrade
Mass fixes: Vitess upgrade
Mass fixes: Multiregion / VTickets
What did work:
Reaching out early and often
A qualitative scale of capacity trouble
Everything is great
OK, some slow queries
Mostly OK but growing fast
Early signs of trouble
Ongoing trouble
Either really small and simple db, or a team that’s really on top of things
Most keyspaces are like this: no need to chase after minor things
Nothing wrong for a while, and then suddenly … problems
Early signs of trouble: mild throttle + lag not enough to page, intermittent errors, support reqs asking why
Ongoing major trouble:
Pages, emergency support reqs, critsits, white glove service
Level 0
Level 1
Level 2
Level 3
Level 4
(i.e. how close is your “butt to the fire”)
Acute
problems
Chronic
problems
A tale as old as time
How does our tooling serve these use cases?
Everything is great
OK, some slow queries
Mostly OK but growing fast
Early signs of trouble
Ongoing trouble
Level 0
Level 1
Level 2
Level 3
Level 4
Slow query e-mails / ops items
Weekly ops review
Weekly
Ops review
SQL page + ping, alert routing, product team page
How to notify Users:
What the future might hold
Conclusion?
TL;DR: How to get humans to adopt desirable behaviors?
The small print
How to get started
Questions, comments, nice words:
mali+percona@akmanalp.com
Thank you