AWS for Industries
Success Strategies for Moving to a Microservice Architecture in CPG
In my last blog post (Three Steps for Modernizing Your DTC Ecommerce Website), I shared three strategies for modernizing your direct-to-consumer (DTC) ecommerce website:
- Lift and shift your DTC ecommerce website to AWS.
- Decompose your ecommerce website and rearchitect it with microservices.
- Move to serverless computing so you can focus on your business.
Why Microservices in Consumer Packaged Goods (CPG)?
In this post, I’ll dive deeper into the strategy to rearchitect your website with microservices. This is especially relevant for consumer goods (CPG) companies. I’m starting with the premise that your DTC website is a monolith, built with legacy technologies and managed by a team of developers and DBAs. With the emergence and mainstreaming of cloud technologies and the turbulence brought on by the pandemic, now more than ever, brands need a flexible, nimble ecommerce website.
Traditional ecommerce websites are anything but flexible. When you use microservices, each website process, like a product catalog, is designed and developed as an independent component. The different microservices communicate with each other through APIs. This modern design enables you to fix bugs and deliver new website features much faster, which improves customer experience, differentiates your business, and ultimately, increases revenue.
A Strategy for Decomposing Your Ecommerce Application
Rearchitecting your ecommerce website with microservices requires thoughtful planning. Start by prioritizing the order in which you’ll rebuild your website functionality as microservices. I refer to this process as decomposing because you’re identifying each application process and planning how to rebuild the functionality with microservices.
A typical ecommerce website includes:
- Home page
- Product search
- Product catalog
- Product pricing
- Promotions
- Payments
- Product inventory
- User profile
- Shopping cart
- Checkout flow
- Static contents
- Store locator
- Personalized contents and personalization
I divide the common features into functionality that’s easily cached (or more static in nature) and processes that can’t easily be cached (or are more dynamic). Using these categorizations, I’ve created these two groups:
Group 1: Easily Cached
- Home page
- Product search
- Product catalog
- Product pricing
- Static contents
- Store locator
Group 2: Not Easily Cached
- Promotions
- Payments
- Product inventory
- User profile
- Shopping cart
- Checkout flow
- Personalized contents and personalization
Don’t Try to Boil the Ocean!
If you’re not familiar with this expression, it means don’t try to do too much. In this case, don’t try to rearchitect your ecommerce site all at once. Instead, do the work in carefully planned phases. This is because you want your existing, legacy ecommerce site to be operational while you’re building out your new modern website with microservices.
Here’s the roadmap I recommend: Start with a few facelift-type projects to the home page, product catalog, product search, and search results page. Note these are all group 1 items. When you rearchitect these items as microservices, you’ll immediately give customers the impression that you’ve got a completely new website even though you’ve just begun your journey.
If you’ve been asked to improve the page response times to enhance the customer experience, I recommend you also focus on the functionality in group 1. Identify the features that you think will have the most impact and rebuild them as standalone microservice components to serve the website traffic directly or through API calls.
Why This Strategy?
You might wonder why I suggest that you start with group 1 instead of group 2. First, the features in group 1 are usually more independent of each other. Second, these features are usually backed by a separate application, like a search engine or a caching system, so you can move them out of the ecommerce application more easily.
Third and most important, when you start the decomposition/rearchitecture effort with group 1, you give your development team an opportunity to learn to write the code on AWS in the language with which they are familiar, without worrying too much about breaking other dependent features. Your development team can learn more about the AWS shared responsibility model to manage your applications on AWS virtual servers.
Additionally, you can containerize your code by using AWS services like Amazon Elastic Kubernetes Service (Amazon EKS) and Amazon Elastic Container Service (Amazon ECS). Both provide a managed container orchestration service, which natively supports a microservice architecture. They provide scalability, resiliency, and security. Customers such as Duolingo, Intel, Autodesk, and General Electric use these services for their production workloads.
If your team works methodically through the steps in this strategy, your entire ecommerce website will be functioning with microservices. Your organization will be on the path to use other modern development methods like DevOps rather than performing the undifferentiated heavy lifting of server and database management.
To learn more about AWS for CPG, contact your AWS account team.