DEV Community

Cover image for A Treasure Hunt Engine Designed for Demos, Not Operations
mary moloyi
mary moloyi

Posted on

A Treasure Hunt Engine Designed for Demos, Not Operations

The Problem We Were Actually Solving

I'll never forget the night our team's custom search engine for Hytale's upcoming online game, Treasure Hunt Engine, went down for the third time in a week, sending our production operator on a frantic 3am hunt through Veltrix configuration. It was clear that the real problem wasn't the engine itself, but how it was integrated into our system architecture. We had optimized for flashy demos over operational stability, and it was time to pay the price.

What We Tried First (And Why It Failed)

When we first designed Treasure Hunt Engine, we prioritized ease of implementation and customizability. We chose a microservices architecture, with each component responsible for a specific aspect of search functionality: indexing, querying, and result ranking. Sounds great in theory, but in practice, this approach led to a mess of interdependent services that were hard to diagnose and maintain. When the engine failed, it was like trying to find a needle in a haystack – or in this case, a stacktrace in a jumbled mess of logs.

The Architecture Decision

After the third downtime, we decided to revamp the search engine's architecture. We replaced the microservices monstrosity with a single, scalable search service using Elasticsearch. This change had a significant impact on our system's stability and maintainability. We also implemented a more robust logging system, which helped us pinpoint issues much faster. But the real game-changer was our decision to use a load balancer to distribute search queries across multiple instances of the search service. Suddenly, our system could handle spikes in search volume without breaking a sweat.

What The Numbers Said After

After the overhaul, our system's uptime improved from 90% to 99.9%. We also saw a significant reduction in average response time, from 500ms to 100ms. But the real metric that told the story was our decreased error rate. From an average of 5 errors per 10,000 requests, we dropped to just 0.5 errors per 10,000 requests. That's a 90% reduction in errors, and a huge relief for our production operator.

What I Would Do Differently

Looking back, I wish we had prioritized operational stability from the start. Instead of focusing on customizability, we should have chosen a more robust and scalable architecture. We also could have benefited from a more thorough testing strategy, including load testing and performance testing. But the real lesson I learned is the importance of careful planning and architectural decisions. A system designed for demos may bring short-term glory, but it's a recipe for disaster in the long run. As a production operator, I can attest that stability and maintainability are worth a few compromises on customizability.


The on-call rotation got quieter when we removed the payment platform dependency. Here is what replaced it: https://payhip.com/ref/dev4


Top comments (0)