HM Land Registry runs on a large estate of microservices, built and evolved by many Scrum teams. The Application Management team owns what cuts across them: the shared concerns no single feature team is responsible for. This is four of those concerns, tackled across a Python and Java 21 microservice estate on Kafka, to GOV.UK standards.
The remit: cross-cutting concerns
Feature teams own their slice of the product. The cross-cutting concerns fall between the slices: the event flow that spans services, the observability that is only useful if it is consistent, the data-consistency guarantees that break only where two systems meet, the performance of endpoints that many teams depend on. Application Management is where those live, so working across team and service boundaries is the normal case, not the exception.
The slow title search
Title search is one of the busiest paths on the estate, and under concurrent load it was slow. The cause was an N+1 query pattern: one query listed a page of titles, then each title fetched its entries in a separate query, so a page of results became dozens of round-trips to the database. Under many searches at once, those round-trips swamped it.
Before: an N+1 query pattern
// One query for the page of titles…
List<Title> titles = titleRepository.searchByArea(area, pageable);
// …then a query per title for its entries. N titles means N+1 round-trips,
// and under concurrent search load they swamp the database.
for (Title title : titles) {
title.setEntries(entryRepository.findByTitleId(title.getId()));
}After: batch the children, index the access path
List<Title> titles = titleRepository.searchByArea(area, pageable);
List<Long> ids = titles.stream().map(Title::getId).toList();
// One query for every entry on the page, grouped in memory. N+1 becomes 2.
Map<Long, List<Entry>> byTitle = entryRepository.findByTitleIdIn(ids)
.stream().collect(groupingBy(Entry::getTitleId));
titles.forEach(t -> t.setEntries(byTitle.getOrDefault(t.getId(), List.of())));Backed by an index matching the new access pattern: create index idx_entry_title_id on entry (title_id). A page of results went from N+1 queries to two, and response times came back down under load.
The bug that only showed under load
Some data-consistency issues appeared only under concurrent transaction load, the hardest kind to pin down. No single team sees them, because the failure lives between services rather than inside one: a second transaction reads shared state in the window between two writes that span a service boundary, and sees a half-updated world.
Root-cause analysis traced those failures across service boundaries to their source, and targeted fixes drove measurable improvements in processing reliability. The tracing was only possible because the telemetry had been made consistent first.
Making the mesh debuggable
A distributed system is only debuggable if its telemetry is. Structured logging patterns were introduced across the microservice mesh so a single request could be followed as it crosses services, making distributed tracing tractable and raising the observability standard for every team that has to follow a request through the estate.
Going event-driven
Underneath those fixes, the event flow itself was modernised.
- From RabbitMQ to Kafka. The messaging backbone was upgraded from RabbitMQ to Kafka, for the throughput and durability a national event flow needs, and application-processing pipelines were decoupled onto it, so downstream registration services no longer waited on the steps ahead of them.
- Fault tolerance across the flow. Decoupling the land-transaction event flow meant a slow or failing downstream service no longer stalled the whole pipeline, raising resilience across the estate rather than in one team.
Rigor and the team
- Regression across the surface. Postman collections covering the full API surface made regression testing across service boundaries reliable, and lifted the test-engineering practice on the team.
- Working across teams. Cross-team mentoring, code reviews and Agile ceremony leadership, with raised standards in documentation, architecture and Jira practice throughout.
- To government standards. Delivered to GOV.UK service standards and GDS expectations, as public-facing government digital services require.
The thread
The thread through all of it is the craft of a senior engineer on shared infrastructure: not a headline system, but a large estate made faster on its hot paths, correct under concurrency, and debuggable across its seams. The hardest problems here live between the teams, which is exactly where Application Management works.
