TeaStore: Adapting with Microservices for Success
Discover how TeaStore uses microservices to adapt and thrive in changing conditions.
Simon Bliudze, Giuseppe De Palma, Saverio Giallorenzo, Ivan Lanese, Gianluigi Zavattaro, Brice Arleon Zemtsop Ndadji
― 6 min read
Table of Contents
- What is TeaStore?
- Making TeaStore Adaptable
- Mandatory and Optional Services
- External Services
- Local Services
- Different Levels of Configuration
- The Magic of Adaptation
- Scenario 1: Database Unavailability
- Scenario 2: Cyberattack on External Services
- Scenario 3: Cloud Provider Outage
- Scenario 4: Sudden Traffic Increase
- Scenario 5: Malicious Traffic Increase
- Scenario 6: DevOps Requirements Change
- Conclusion
- Original Source
In today's world of technology, we have all kinds of cool tools that help businesses manage their services on the cloud. One great example of this is the TeaStore, a setup that uses microservices to get things done. But what's a microservice? Think of it as a bunch of small, independent parts that work together, much like a team of superheroes. Each superhero has a specific power that helps them tackle different challenges.
So, let’s dive into the world of TeaStore and see how it adapts to different situations while keeping things running smoothly.
What is TeaStore?
TeaStore is a handy model that showcases how small services can come together to create a larger application. It has five main services:
- WebUI: This is the friendly face that users interact with.
- Auth: This service checks whether users are who they say they are.
- Persistence: This is where all the important data is safely stored, kind of like a super secure vault.
- Image Provider: This service is responsible for showing images of products.
- Recommender: This one suggests products based on what other people have bought or what users are currently looking at.
TeaStore has been a great example in the world of microservices. However, its original design didn’t offer enough flexibility to handle various situations and unexpected events that could pop up in real life.
Making TeaStore Adaptable
To tackle these limitations, the TeaStore has been given a makeover to become more adaptable. This new version introduces the idea of mandatory and optional services. Think of it like a buffet where you must have some dishes (mandatory services) to fill your plate, while others (optional services) can be added based on your personal tastes.
Mandatory and Optional Services
The mandatory services, which are the WebUI, Image Provider, and Persistence services, are the lifeline of the system. Without them, the whole thing just won’t work. However, optional services like the Recommender can be added when needed. If it's not present, no worries! Users can still browse products as anonymous guests.
External Services
Furthermore, certain services can be managed by external providers. Imagine ordering pizza from your favorite restaurant rather than making it yourself. This is how the external service works. For example, an external provider could handle user logins through Single Sign-On (SSO), making life easier for the users who can simply log in with their existing accounts from places like Google.
Local Services
Now, sometimes you may find yourself in a situation where external services are temporarily unavailable. Fear not! With the adaptable TeaStore, there are local services ready to step in. These local services can provide basic functionality until the external services are back online. It’s like having a backup plan for your favorite pizza place-if they close, you can always whip up something at home!
Different Levels of Configuration
To keep things running smoothly, the adaptable TeaStore has three different levels of setup:
-
Barebone Configuration: This is the basic setup where only the mandatory services operate. It’s like feeding a baby with just a spoon-minimum but necessary.
-
Barebone + Recommender in Low-Power Mode: Here, you add the Recommender service, but you run it in a low-power mode, meaning it will cut down on energy and resources while still providing some suggestions.
-
Full Configuration: This is the top-tier setup with all services working in full power. The external providers are in action, and everything functions as intended. Think of it as the all-you-can-eat buffet, where everything is available and ready to be devoured.
The Magic of Adaptation
The beauty of the adaptable TeaStore is its ability to change in response to different scenarios. Let’s look at some situations where things may not go as planned.
Scenario 1: Database Unavailability
Imagine the database decides to take a nap, and all queries start timing out. The WebUI does a little dance to adapt and shows a friendly maintenance message instead of just crashing and burning. Once the database is back up, the WebUI resumes normal operations. How polite!
Scenario 2: Cyberattack on External Services
Should a cyberattack happen, the external services might have to shut down for safety reasons. Here, the system quickly switches to its local services to keep things running at a basic level. The WebUI gracefully disables new logins and registrations until everything is back in action. Talk about being calm under pressure!
Scenario 3: Cloud Provider Outage
If the cloud provider experiences a power failure, the services may go offline. In this case, the system switches to its barebone configuration to keep the essential features operational. Once the external services are up and running again, it goes back to full configuration faster than you can say "cloud computing."
Scenario 4: Sudden Traffic Increase
What if tons of users flood the WebUI on the same day, like a Black Friday sale? The system must adapt quickly to handle the extra workload. With some clever scaling, it can keep up with demand.
If the Recommender service starts to struggle under the weight, it can switch to a low-power mode that provides recommendations based on basic popularity. It’s like a human running out of breath; sometimes, you need to take a breather!
Scenario 5: Malicious Traffic Increase
If a sudden spike in traffic is due to a DDoS attack, the system puts on its armor. It can limit access to the Auth service, shift the Recommender to low-power mode, and activate its local cache services to reduce its reliance on external services.
Scenario 6: DevOps Requirements Change
The adaptable TeaStore can also respond to requests from developers. If they want to change features, like adding a new payment method or updating the Recommender algorithm, the system can switch configurations quickly. It's like a chameleon changing colors-ready for anything!
Conclusion
The adaptable TeaStore is a fascinating example of how technology can be flexible to meet varying demands. By having mandatory and optional services and being ready to adjust to different scenarios, it keeps everything running smoothly.
Just like your favorite buffet with plenty of options, you can customize the setup to fit your needs while keeping the experience enjoyable for everyone involved. So whether you’re a casual user or a business owner, the adaptable TeaStore has got your back in the ever-changing world of technology.
Title: Adaptable TeaStore
Abstract: Adaptability is a fundamental requirement for modern Cloud software architectures to ensure robust performance in the face of diverse known and unforeseen events inherent to distributed systems. State-of-the-art Cloud systems frequently adopt microservices or serverless architectures. Among these, TeaStore is a recognised microservice reference architecture that offers a benchmarking framework for modelling and resource management techniques. However, TeaStore's original configuration lacks the flexibility necessary to address the varied scenarios encountered in real-world applications. To overcome this limitation, we propose an enhanced variant of TeaStore that distinguishes between mandatory and optional services while incorporating third-party service integration. Core services such as WebUI, Image Provider, and Persistence are designated as mandatory to maintain essential functionality, whereas optional services, such as Recommender and Auth, extend the architecture's feature set. We outline the design and configuration possibilities of this adaptable TeaStore variant, aimed at enabling a broader spectrum of configurability and operational resilience.
Authors: Simon Bliudze, Giuseppe De Palma, Saverio Giallorenzo, Ivan Lanese, Gianluigi Zavattaro, Brice Arleon Zemtsop Ndadji
Last Update: Dec 20, 2024
Language: English
Source URL: https://arxiv.org/abs/2412.16060
Source PDF: https://arxiv.org/pdf/2412.16060
Licence: https://creativecommons.org/licenses/by/4.0/
Changes: This summary was created with assistance from AI and may have inaccuracies. For accurate information, please refer to the original source documents linked here.
Thank you to arxiv for use of its open access interoperability.