![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
In the world of microservices architecture, effective testing has become a significant challenge for development teams. As systems grow more complex and teams scale, traditional testing approaches often fall short. Let’s take a look at common testing strategies, their limitations and introduce a promising solution: sandboxes in a shared environment.
When working on a microservices-based system, developers face a crucial question: How do you ensure that changes in one service work well with all the other components before pushing to production?
Initially, running a complete replica of the system on each developer’s machine seems ideal. It promises the convenience of making changes, running tests and verifying functionality before code submission.
However, this approach quickly becomes impractical as the system grows. Running numerous services, databases and dependencies locally is resource-intensive and often leads to performance issues. Keeping these environments synchronized with the latest changes from all teams is a constant challenge. Furthermore, discrepancies between local setups and production environments can lead to the notorious “it works on my machine” problem.
Given the limitations of local testing, many teams opt for a shared staging environment. This centralized, production-like environment seems to address the issues of local testing.
In practice, however, shared staging environments present their own set of challenges. As multiple teams attempt to test simultaneously, contention for resources becomes a significant issue. Developers often find themselves waiting for access, leading to delays in the development process. The stability of the staging environment also becomes a concern, with untested code potentially disrupting the work of other teams.
To mitigate the issues of a single shared environment, some organizations implement a multi-environment strategy. This typically involves a series of environments such as dev, QA, UAT and pre-prod, creating a pipeline for code to move through before reaching production.
While this approach appears to solve the contention problem, it often creates new challenges. Rather than eliminating resource conflicts, it disperses them across multiple environments. Maintaining consistency across these environments becomes increasingly complex, leading to configuration drift. The process of promoting code through multiple environments can significantly slow down the release cycle, potentially negating the agility benefits of a microservices architecture.
The concept of spinning up environments on demand for each developer or team is another approach some organizations explore. In theory, this eliminates contention and provides isolated testing environments.
However, this strategy can lead to substantial cost increases as infrastructure is duplicated for each instance. The time required to spin up a full environment can also be a deterrent, potentially encouraging developers to bypass thorough testing in favor of quicker code pushes.
Moreover, these on-demand environments can quickly become outdated without constant updates. This problem is exacerbated as release frequency increases, a common scenario in microservices architectures. In rapidly evolving systems, an environment that was current yesterday may be significantly out of date today, rendering test results less reliable.
Given the limitations of these common strategies, a new approach has emerged: sandboxes in a shared environment. This method, adopted by companies like Uber, Lyft and DoorDash, offers a promising solution to the challenges of microservices testing.
The core concept involves maintaining a single, production-like pre-production environment shared by all teams. When developers need to test changes, they deploy modified versions of specific services within this shared environment. Intelligent routing mechanisms then direct test traffic to these new versions while maintaining regular traffic flow to stable versions.
This approach combines the benefits of isolated testing with the efficiency of a shared environment. It allows for realistic testing without the need for complete environment replication, addressing many of the issues associated with other testing strategies.
The sandbox approach in a shared environment offers several key advantages:
This approach is particularly beneficial for organizations with:
While implementing such a solution in-house can be complex, tools are now available that make this approach accessible to companies of all sizes and industries. Signadot, for example, offers a solution that enables organizations to use sandboxed environments for microservices testing without the need for extensive in-house development.
Companies across various sectors have seen significant benefits from adopting this approach. Brex, a Fintech company, has used Signadot to streamline its testing processes and accelerate feature delivery. Earnest, a student loan refinancing company, improved its development workflow and reduced time to market for new features. ShareChat, a social media platform, enhanced its ability to test complex microservices interactions. These case studies demonstrate the broad applicability and benefits of the sandbox approach in shared environments.