Temporal provides state persistence, built-in retry delays, and long-running tasks, which are crucial capabilities when creating a database platform.
Industry
Retail
Use Case
Orchestrating reliable, long-running, multi-region database provisioning at scale
Company Size
Megacorp
SDK
Go
Temporal
Self-Hosted
When Demet Mutlu founded Trendyol in 2010, few could have predicted the meteoric rise that would transform this modest Turkish fashion startup into the country’s e-commerce juggernaut. The journey accelerated in 2018 when Alibaba Group became a major shareholder, injecting both capital and technological expertise.
Fast forward to today, and the numbers tell a remarkable story. By 2023, Trendyol was generating a staggering $4 billion in revenues, commanding the Turkish e-commerce market with a particularly dominant presence in fashion — capturing nearly half of all online sales in that category alone.
Behind these impressive figures lies a platform that has become indispensable to Turkish consumers and merchants alike. With over 40 million active customers and 150+ million monthly web visits, Trendyol has captured approximately 50% of Turkey’s online fashion market and an even more impressive 70% of online beauty sales.
But Trendyol isn’t content with being just a fashion destination. They’ve expanded their horizons to offer everything from electronics to home furniture, cosmetics, and beyond. Along the way, they’ve become a vital partner for more than 200,000 independent traders and SMEs, delivering over a million packages daily to doorsteps across Turkey.
This explosive growth brought its own set of challenges, particularly for the technical teams responsible for keeping Trendyol’s digital foundation rock-solid while scaling to meet ever-increasing demands.
Every e-commerce platform lives or dies by its technical infrastructure, and for Trendyol, database reliability is essential. As transaction volumes soared and customer expectations rose, their database team found themselves facing a complex puzzle.
First came the geographical challenge: how to create and manage database deployments across multiple regions — specifically Istanbul and Ankara — to ensure customers would always have a responsive experience regardless of their location. These deployments needed iron-clad resilience against infrastructure problems, which sometimes meant dealing with provisioning processes that could stretch from hours into days or even weeks when underlying technical issues arose.
We need to wait until two database clusters are ready... but database creation may take weeks or days, and we need to wait.
Then there was the replication puzzle. Connecting these database instances wasn’t just about redundancy — it was about creating a seamless experience where data remained consistent while allowing traffic to be intelligently distributed. If Istanbul’s data center hiccupped, customers needed to be automatically routed to Ankara without missing a beat or losing a single transaction.
Most critically, there was the human element. Trendyol’s internal development teams relied on database infrastructure being provisioned reliably and predictably. They needed a system they could trust implicitly — one that would deliver what they needed without requiring them to understand the considerable complexities happening behind the scenes.
Like many engineering teams tackling complex problems, Trendyol’s journey included some approaches that ultimately proved inadequate.
Their first attempt used a traditional programming model with Golang. It quickly became apparent that this approach couldn’t handle the reality of database creation — a process that might run for days and encounter any number of obstacles along the way. Simple function calls and basic error handling just weren’t up to the task.
Next, they explored what many would consider the natural evolution: an event-driven architecture using Apache Kafka. This offered better handling of asynchronous operations but introduced a whole new set of headaches: building custom state management, wrestling with race conditions, implementing robust retry mechanisms, and managing Kafka itself.
Kafka does not have built-in error retry or delay features. We needed to write our own mechanism... and it is very hard to implement this error management.
The resulting system would be a tangled web of components that, while functional, would obscure rather than illuminate the underlying business process.
What Trendyol really needed was a way to express their database provisioning workflow that mirrored how a human would think about the process — “create databases in both regions, then set up replication between them” — while automatically handling all the messy details of state persistence, retries, and long-running operations.
The breakthrough came when Trendyol’s team shifted their perspective. Instead of diving straight into implementation details, they took a step back and visualized their ideal process.
This exercise clarified their thinking and created a shared understanding that bridged technical and business perspectives. The workflow was elegantly simple: start with a developer’s request for a multi-region database, create instances in Istanbul and Ankara in parallel, and once both were ready, establish replication between them.
With this clear model in mind, they turned to Temporal.
What made Temporal the perfect fit? It offered a comprehensive solution to the exact set of problems Trendyol was facing:
The team built a hierarchical Workflow design that elegantly mirrored their diagram. The main Workflow orchestrated the entire process, spawning child Workflows for database creation in each region.
These child Workflows were designed with a crucial pattern: rather than attempting to block until database creation completed, they implemented a polling approach. Each Workflow would periodically check if the requested database was ready using a “check database is created” Activity. If not ready, the Workflow would use Temporal’s workflow.sleep()
function to wait for a configured interval before checking again. This pattern allowed them to handle the reality that their underlying infrastructure — Terraform — might take significant time to provision the resources.
Once both regional instances were ready, the parent Workflow would seamlessly move to the final step: establishing replication between them.
What made this approach particularly powerful was how Temporal’s Event History and Replay capabilities ensured that Workflows could pick up exactly where they left off after any interruption. If a server crashed midway through a week-long database deployment, no problem — the Workflow would resume from that exact point when the system came back online.
For the operations team, the Temporal Web UI was a game-changer. They could now watch Workflows progress in real-time, quickly identify any issues, and understand exactly where things stood at any moment.
The transformation was impressive. Database provisioning at Trendyol went from being a potential reliability bottleneck to a showcase of resilient systems design.
Infrastructure complications that once would have derailed the entire process became more speed bumps, handled automatically by retry logic built into the Workflows. Even when facing challenging technical issues that might take days to resolve, the system would patiently persist, eventually delivering what was promised without requiring manual intervention or elaborate workarounds.
The impact on Trendyol’s engineering culture was equally profound. The database platform team found themselves freed from the cognitive burden of managing complex state machines and error handling. Their code now directly reflected their business process, making it vastly easier to understand, maintain, and extend as requirements evolved.
For developers requesting database resources, the improvement in experience was night and day. They gained a new level of confidence in the platform, knowing that their requests would be fulfilled regardless of what technical gremlins might appear along the way.
Developers should trust the platforms... knowing they will eventually get their database.
The transparency provided by the Temporal Web UI turned what was once a black box into a clear, observable process.
Perhaps most importantly for a rapidly growing business like Trendyol, the solution scaled naturally with their expansion. As they continued to add customers, products, and transactions, their Temporal-based database platform kept pace, reliably provisioning resources across their growing infrastructure footprint.
Trendyol’s database platform journey offers valuable insights for any organization grappling with complex, long-running processes and the need for absolute reliability.
By approaching their problem from a Workflow perspective rather than purely as a series of events, Trendyol created a solution that naturally aligned with how humans think about processes. This made the system more intuitive to build, understand, and maintain.
Rather than hoping infrastructure problems wouldn’t occur, Trendyol built a system that accepted the inevitability of these issues. Their platform was designed to recover from failures gracefully, making it truly resilient in the face of real-world challenges.
By creating a system that developers could trust implicitly, Trendyol’s database team transformed themselves from a potential bottleneck into valued partners in the company’s growth. The reliability and transparency of their platform meant developers could focus on building features rather than worrying about infrastructure.
For organizations building critical infrastructure platforms — especially those involving long-running processes that must be resilient to failures — Temporal offers a powerful model that bridges the gap between business requirements and technical implementation. By handling the complex challenges of state management, error handling, and process visibility, it allows teams to focus on what matters most: delivering reliable, scalable systems that support their business’s growth.
Improving your business can be simple just like it was for Trendyol. Start today with a free trial of Temporal Cloud with $1,000 in free credits.
Ready to learn why companies like Netflix, Doordash, and Stripe trust Temporal as their secure and scalable way to build and innovate?