Mettle

Platforms and infrastructure

Platform modernised while the alarms kept running

TermoSense, 2026

143 s → 1.3 stime for one query that counts alarms, on the live database

The situation

In 2026 the platform had run for 18 years and was on PHP 7.4, with gateways on a design from 2010: a VPN, an old web-service protocol (SOAP) and polling. It had to be brought up to date without stopping the alarms.

What Joakim did

  • Took it from PHP 7.4 to 8.4 by moving to a new server: one test suite ran on both versions, and production cut over when one IP address moved.
  • Found and rewrote the slowest queries on the live database.
  • Built gateway 2.0: each box registers once and gets its own secret, reports over HTTPS with short-lived tokens and takes commands over a connection it opens itself.
  • Did the 2026 work with an AI coding agent, reviewing what it wrote.

What came of it

The server move left every gateway as it was, and the fleet is now being moved to gateway 2.0.

Packages