Security · Reliability
Hardening the core investment platform
Years of steady work on the Grails system at the heart of the business: upgrading it, securing it, and fixing the failure modes that only show up in production.
01 Problem
The core platform holds client accounts, goals, deposits and withdrawals. It predates most of the surrounding services and has to keep running while everything around it changes — new identity provider, new event streams, new channels.
02 Constraints
- Zero tolerance for errors in withdrawal and account-ownership logic.
- Changes must coexist with newer services consuming and producing the same events.
03 Architecture
- 01WithdrawalsVerification codes bound to the account owner; bounded code generation.
- 02IdentityExisting staff linked to Keycloak identities.
- 03EventsConsumer groups and partition rebalancing fixed; no self-consumption.
- 04DatabaseTargeted indexes for queries that timed out in production.
- 05ChannelsUSSD APIs, PIN reset, referrals and the new provider contract.
04 Decisions
Bind verification to the owner
- Chose
- Withdrawal codes are validated against the account owner who requested them.
- Instead of
- Validate the code alone.
- Why
- Closed a path where a valid code belonging to someone else could confirm a withdrawal.
Bounded code generation
- Chose
- Draw verification codes from a bounded pool with an explicit exhaustion path.
- Instead of
- Random generation until an unused code appears.
- Why
- Unbounded generation loops forever once the code space is exhausted.
Ignore your own events
- Chose
- Consumers skip messages the platform itself published.
- Instead of
- Process every message on the topic.
- Why
- Prevents feedback loops once the monolith both produces and consumes shared topics.
05 Implementation
- Worked across both the Grails 4 and Grails 6 generations of the platform, including Kubernetes deployment and service-discovery configuration.
- Added indexes through versioned migrations for lookups that were timing out.
- Built Kafka consumers that provision client, staff and partner users from the authentication service.
06 Outcomes
- Two withdrawal-verification flaws closed: code ownership and code-space exhaustion.
- Production query timeouts resolved with targeted indexes.
- Kafka rebalancing and self-consumption issues fixed as the platform moved to event-driven integration.
Outcomes are limited to what I can verify and share. Internal names, partners, infrastructure details and production data are deliberately omitted.