AWS Partner Network (APN) Blog
How JBS Dev Leveraged AWS Lambda to Modernize a National Pet Retailer’s Mobile App Backend
By Phil Horwitz, CTO – JBS Dev
By Venkat Gomatham, Sr. Solutions Architect – AWS
JBS Dev |
In an increasingly competitive and digitally-driven retail landscape, consumers want and expect seamless, multi-channel experiences. This allows them to shop and interact with brands and retailers when, where, and how it’s most convenient for them. To achieve this, retail enterprises need modern, resilient, and agile backend IT systems.
A national pet retailer was in the middle of a year-long development of its mobile application. The goal of the project was to develop a personalized ecommerce experience through mobile platforms. This is a differentiating functionality to improve the in-store and online shopping experience for customers, and the focus is to add in-store interactions, enhanced mobile shopping and scheduling of services.
One year into the project, and with less than 25% of the project complete, this national pet retailer realized the complexity and turned to JBS Dev for help.
In this post, we’ll discuss how the JBS Dev team leveraged AWS Lambda to modernize the retailer’s mobile backend system to be reliable, performant, secure, resilient, and cost effective. This solution enabled the retailer to innovate faster and deliver differentiating functionality to customers, resulting in increased return on investment (ROI), speed to market, and competitive edge to the retailer.
JBS Dev is an AWS Specialization Partner with the Retail Competency and AWS Lambda service delivery designation. JBS Dev has been delivering leading-edge software and application-based solutions for clients for over 20 years to support proprietary business models and innovative technological solutions.
The Challenge
As JBS Dev team embarked on this transformational journey for the retailer, conducting a detailed discovery of the stalled mobile app development project. This determined existing technical challenges and strategized a best way to proceed, and the team found the cross-platform application designed for both iOS and Android operating systems was experiencing significant performance problems. It was slow, broken, and difficult to deploy and integrate with other internal systems.
The bulk of these performance problems were due to a third-party monolithic legacy backend system. This commercial off-the-shelf (COTS) platform was responsible for connecting with data, desperate internal systems, and automating workflows, but it was extremely complex and inflexible to add new functionality.
The Approach
JBS Dev prepared a persuasive business case for modernizing per the retailer’s mobile backend system. The new solution aligns with the organization’s overall digital modernization initiative and industry best practices. JBS Dev proposed a solution that is serverless, event-driven, and uses microservices. AWS Lambda plays a significant role in this solution and is used to create microservices and orchestrate workflows.
JBS Dev secured the customer’s approval and started with a proof of concept (PoC) to show the “art of possible” by leveraging AWS services to build the mobile application’s backend system. The PoC system was built quickly and incorporated key business functionality of the retailer’s ecommerce platform needed for the mobile application.
The solution was able to connect into several backend systems and quickly expose the APIs required for the mobile application. JBS Dev used Zappa, an open-source tool for building and deploying serverless python applications, to build event-driven Python applications to be hosted on Lambda. This gave the customer the confidence to approve and proceed with the production build.
The JBS Dev team then created the target architecture that focused on functional and non-functional requirements. They followed the AWS Well-Architected Framework to ensure the architecture was performant, reliable, secure, and resilient. JBS Dev incorporated continuous optimization into it development process, which was possible as JBS Dev enabled monitoring and observability for the workload while performing testing and code reviews iteratively.
The team developed microservices using Docker containers and deployed them on Lambda as they were building microservices for the backend. JBS Dev leveraged Amazon Elastic Container Registry (Amazon ECR) to store container images knowing that infrastructure as code (IaC) is the key ingredient to success for any cloud deployment.
The team automated the entire infrastructure deployment using a CI/CD pipeline while leveraging Terraform to efficiently manage the entire cloud architecture that was deployed on AWS for the mobile app. It provided a consolidated view of everything deployed on AWS.
Design and Execution
The mobile backend system was designed to be serverless and event-driven to make it agile and easy to manage without compromising on performance, reliability, and security. The architecture includes several APIs hosted using Amazon API Gateway backed by microservices hosted on Lambda.
Some of the systems that required integration with the application code running in Lambda included:
- Backend of the retailer’s ecommerce system responsible for driving its website
- Order management
- Inventory management
- Customer profile (both pets and “pet parents”)
- Customer loyalty
- Third-party authentication for payment providers
- Content management system for product images and other files
Figure 1 – Multi-region architecture of the mobile backend system.
The solution leveraged several other AWS services like—Amazon Route 53 to easily and cost-effectively configure custom API domain names, Amazon EventBridge to set up scheduled and event-driven tasks without any servers, Amazon Simple Storage Service (Amazon S3) to efficiently store objects in the cloud, and Amazon CloudFront for API caching to improve performance.
Amazon Aurora, a relational database management system (RDBMS) built for the cloud with full MySQL and PostgreSQL compatibility, was chosen as the commercial-grade database because it’s well-suited for the needs of the pet retailer’s mobile app.
Another AWS tool was brought into the mix to make the application more resilient to potential database failures—Amazon RDS Proxy. This service allowed the retailer’s mobile app to pool and share connections established with Amazon Aurora. This improved database efficiency, performance, scalability, and application availability which reduced failover times by up to 66%.
JBS Dev leveraged Amazon ElastiCache to decrease response time for users. With ElastiCache, cost-optimized performance was accomplished by adding a cached response for data frequently read by Lambda so it doesn’t have to rely on integrated systems to calculate an appropriate response each time.
With the new architecture, new business functionality was added to the application, like pet grooming, training, and health/wellness visits to in-store veterinary hospitals. These features resulted increased non-functional requirements like recovery time objective (RTO) and recovery point objective (RPO).
JBS Dev leveraged AWS global infrastructure and automation to evolve its architecture into a multi-region architecture with minimal effort. By maintaining Lambda functions and databases in secondary regions, the team provided the highest levels of data redundancy and resiliency ensuring critical business continuity.
JBS Dev innovatively adopted Lambda to handle incoming HTTP requests as WSGI-typed. While running a WSGI (Web Server Gateway Interface) application in Lambda is now more common, this implementation stood out due to the seamless translation achieved from Amazon API Gateway invocations to WSGI requests.
This transformation process was facilitated by Zappa and later Mangum, which played a pivotal role in enabling this transition. Eventually, JBS Dev went on to develop a custom Lambda handler function that’s used to handle, process, and respond to application management commands, asynchronous function invocation events, and incoming HTTPS traffic. This included file uploads within Lambda limits and scheduled event invocations through EventBridge.
In addition to the core WSGI functionality and use cases discussed above, this project required real-time messaging capabilities, particularly for WebSocket services. To meet this demand, JBS Dev went beyond the standard offerings provided by Zappa and Mangum by leveraging a custom handler to implement a WebSocket-based real-time chat client, all driven by AWS Lambda.
This innovative combination of AWS Lambda, Zappa, Mangum, and JBS Dev in-house enhancements allowed for the delivery of a robust and scalable solution that not only met the customer’s specific needs but also showcased the versatility and adaptability of serverless architecture in modern application development.
Customer Benefits
The success of JBS Dev in harnessing these technologies underscores a commitment to staying at the forefront of AWS services while pushing the boundaries to deliver exceptional solutions for customers.
The pet retailer realized the following benefits as JBS Dev modernized and migrated the backend system to AWS:
- Alleviated response time to increased user experience
- Easily integrated with retailer’s disparate data stores and systems (both on-premises and in the cloud)
- Increased resilience with AWS global infrastructure
- Increased agility and ability to innovate faster
- Scalable architecture to withstand high request volumes and throughput
- Alleviated costs, maintenance, and overhead by leveraging AWS serverless infrastructure
Conclusion
AWS Lambda, along with other carefully chosen cloud services, were a clear choice to get this leading national pet retailer’s mobile application platform to a highly optimized state that provides functionality and exceptional customer experience for years to come.
Lambda and a modern, multi-region design became the gold standard for new and existing internal applications. The retailer now leverages hundreds of Lambda functions in varying implementation complexities and use cases to achieve highly scalable, available, and performant solutions across the entirety of its IT organization.
This scalable mobile application is up and running at full speed, serving the needs of the national pet retailer’s 25 million active customers with no issues.
For more details on how JBS Dev delivers leading-edge solutions for businesses, visit the website. You can also learn more about JBS Dev in AWS Marketplace.
JBS Dev – AWS Partner Spotlight
JBS Dev is an AWS Specialization Partner that’s been delivering leading-edge software and application-based solutions for clients for over 20 years to support proprietary business models and innovative technological solutions.
Contact JBS Dev | Partner Overview | AWS Marketplace | Case Studies