BISSELL is a family-owned enterprise with over 145 years crafting premium cleansing merchandise that exceed client expectations. BISSELL gives a full vary of flooring care and air therapy merchandise. Related vacuum cleaners – notably robotic vacuums – are a rising phase of their enterprise. BISSELL has 1 million registered vacuum gadgets of their current IoT Platform powered by AWS IoT, and presently 25% of these gadgets are linked within the area. With rising adoption of linked vacuum cleaners all over the world, BISSELL is anticipating 1 million gadgets to be linked within the area within the close to future. BISSELL wished to make sure its IoT platform might scale with this speedy anticipated progress throughout product classes.
BISSELL’s home-grown legacy IoT platform on AWS included a set of REST APIs that enabled totally different members of their IoT ecosystem to entry platform knowledge. The legacy platform labored and carried out effectively, however BISSELL anticipated future ache factors scaling the platform with new merchandise and customers.
On this weblog publish, we present how BISSELL labored with AWS Skilled Companies to enhance their legacy REST APIs as a part of migrating their IoT platform to a brand new structure primarily based on the AWS Related Gadget Framework (CDF). We determine ache factors of the legacy REST API structure after which describe how we redesigned it utilizing CDF’s micro-services method of grouping associated REST APIs right into a single Lambda with proxy integration. Subsequent, we spotlight how the brand new structure contributed to enhancing the scalability, efficiency, and value effectivity of BISSELL’s IoT platform.
Legacy structure challenges
The serverless REST APIs on BISSELL’s legacy IoT platform had been constructed utilizing BISSELL’s Onion Structure, which is a serverless design sample comprised of a number of concentric layers of Lambda capabilities interfacing with one another in the direction of the information entry layer within the core. BISSELL determined to create the Onion Structure as a result of excessive code re-usability.
The area layer of the structure accommodates a set of Amazon API Gateways, and every Amazon API Gateway serves REST API requests originating from a selected area. These domains symbolize shoppers of the BISSELL IoT platform corresponding to a cell app or an online portal. Beneath the area layer is the service layer of the Onion Structure that’s comprised of Lambda capabilities, every of that are devoted to service a selected REST API request. Lastly, the information entry layer of the Onion Structure accommodates a further set of Lambda capabilities that implement Information Entry Object (DAO) interfaces. The info entry layer Lambda capabilities entry IoT knowledge saved in Amazon DynamoDB tables utilizing the DAO interfaces. The next picture exhibits the totally different layers of the Onion Structure.
When a consumer invokes a REST API, the Amazon API Gateway first initiates the Lambda perform within the service layer that handles the requested REST API operation. Subsequent, this Lambda perform invokes a set of Lambda capabilities within the knowledge entry layer as wanted to finish the requested operation. Lastly, the Lambda capabilities return outcomes again to the calling Lambda perform within the service layer, which constructs and returns the ultimate response to the Amazon API Gateways.
The Onion Structure promotes a extremely reusable code base by permitting the service and knowledge entry layers to share Lambda capabilities. Nevertheless, it additionally presents challenges when making an attempt so as to add options and scale to a whole lot of 1000’s of gadgets. First, sustaining greater than 500 Lambda capabilities made it tough for BISSELL to carry out speedy and frequent updates to scale the prevailing REST APIs. Second, the rising chain of invocations between particular person Lambdas coupled with inconsistent database design negatively impacted the platform’s efficiency and value effectivity. Moreover, debugging points turned difficult with builders having to look throughout a number of Lambdas to search out root causes.
Migrating to the brand new structure
BISSELL and AWS Skilled Companies determined emigrate the legacy platform to a brand new resolution developed utilizing the AWS Related Gadget Framework (CDF). CDF is an open supply framework for constructing an enterprise IoT platform. It gives a set of production-ready micro-services referred to as CDF modules, all architected and carried out utilizing native AWS companies and greatest practices. The CDF modules kind a layer above the AWS constructing blocks as proven within the following structure diagram.
The staff started by addressing the inner-most knowledge entry layer of the Onion Structure. The legacy IoT platform lacked a clearly outlined gadget registry to handle a big fleet of gadgets and their relationships to different assets throughout the platform corresponding to customers, gadget varieties, and firmware. Within the legacy platform, knowledge for gadgets and different assets was scattered throughout a number of Amazon DynamoDB tables. This problem, coupled with each static and dynamic knowledge coexisting throughout tables, led to elevated system complexity, stale knowledge, and value inefficiency. As an example, BISSELL needed to create a collection of Amazon DynamoDB queries throughout a number of tables simply to assemble an inventory of gadgets owned by a specific person. This operation consisted of the next steps:
- The Information Entry Object (DAO) first want to question the “Customers Desk” utilizing a person ID as the kind key to acquire all teams which can be related to the person.
- From the returned teams, an array of gadget IDs is constructed by pulling out gadget ID from every group.
- The DAO iterates over every gadget ID, having to question a number of tables to assemble an entire gadget object on every iteration.
The diagram following illustrates this problem by way of a mock state of affairs.
BISSELL and AWS Skilled Companies used the CDF Asset Library to construct a complete gadget registry outlined as a single graph database utilizing Amazon Neptune. In the course of the re-implementation part, the staff migrated sometimes altering or in any other case static knowledge (for instance, device-friendly identify, person e-mail handle) to the Asset Library. However, incessantly altering knowledge, corresponding to gadget utilization metrics, was maintained in Amazon DynamoDB tables. This resulted in a simplified knowledge entry layer that allowed the staff to enhance efficiency and value of the upstream knowledge consumption.
The diagram following illustrates how the CDF Asset Library is ready to cut back the variety of DynamoDB queries from the a number of queries required with the legacy setup to a single Neptune question.
After optimizing the platform’s knowledge entry layer with the CDF Asset Library, the staff labored on migrating from the legacy Onion Structure to a brand new structure primarily based on CDF’s micro-services design paradigm. BISSELL migrated their legacy REST API structure as a part of the CDF Software Layer, additionally referred to as the CDF Facade layer. The Facade layer is an utility layer that accommodates BISSELL’s distinctive enterprise logic and orchestrates the underlying CDF Core modules. The CDF Core modules are carried out as a Lambda with proxy integration, which teams dispersed units of Lambda capabilities right into a single Lambda perform for dealing with a typical service such because the CDF Asset Library. The open supply [AWS Serverless Express] Node Package deal Supervisor (NPM) bundle permits you to simply construct serverless REST APIs utilizing the Specific framework on prime of Amazon API Gateway.
BISSELL’s CDF structure gives a Lambda configured with proxy integration that serves as a single level of entry for all API requests made by widespread shoppers such because the cell and internet purposes. As an example, BISSELL’s cell utility sends all requests to a devoted Amazon API Gateway. From there, Amazon API Gateway makes use of proxy integration to route any requests to a Lambda devoted to dealing with all API operations for the cell utility. The Lambda itself breaks down into three layers. When the Lambda is invoked, the API request first enters a controller, the place it determines what service to name primarily based on the request’s endpoint. The service then calls the Information Entry Object (DAO) to entry the platform’s databases hosted in Amazon Neptune and Amazon DynamoDB.
By migrating to the CDF structure, BISSELL lowered the variety of Lambda capabilities within the platform by 90 %. The brand new controller, service, and DAO design consolidated the code base and lowered troubleshooting efforts. One other key profit was the power to deploy the Lambda as an area Specific server, which contributed to rushing up improvement and troubleshooting points even sooner. This resolution supplied the BISSELL improvement staff the power to rapidly deploy and check the API execution on a developer’s native machine.
BISSELL efficiently migrated their legacy serverless REST APIs to a brand new structure primarily based on a micro-services design paradigm offered by the AWS Related Gadget Framework (CDF). BISSELL now has a extra scalable, performant, and value environment friendly resolution for his or her IoT platform on AWS.
The migration resulted in a 90 % discount within the variety of Lambda capabilities. Put up migration knowledge confirmed a 90 % discount in Lambda prices and a 50 % discount in Amazon API Gateway latency. Moreover, the migration supplied BISSELL a platform that helps agile enterprise enlargement with the power to scale options and gadgets quickly and reliably.
To be taught extra about AWS IoT companies and options, go to AWS IoT or contact us. Additionally, be taught extra about BISSELL’s new IoT Platform within the first publish of this collection.
In regards to the Authors
|Jay Chung is an IoT Architect working within the IoT International Specialty Follow in AWS Skilled Companies. Jay loves partaking with clients to construct IoT options that assist clients remedy their enterprise challenges. Previous to becoming a member of AWS, Jay spent over a decade serving a number of roles within the automotive check software trade together with software program improvement and product administration.|
|Babu Papanna is an IoT Architect working for IoT International Specialty Follow in AWS Skilled Companies. Babu is passionate to research, design & flip clients complicated enterprise challenges in to useful options. Previous to becoming a member of AWS, Babu labored in optical telecom, linked gadgets, IoT, MSP, Wi-fi & gadget administration enterprise verticals.|
|Ramesh Chinnasamy is a seasoned chief for International IoT follow throughout the AWS Skilled Companies International Specialty Follow. He leads IoT options for our clients in addition to develop greatest practices & packaged IoT options. He helps our clients and companions to ship finish to finish IoT options from the sting by way of to the cloud to realize enterprise outcomes.|
|Aaron Pittenger is a Lead Software program Engineer at BISSELL, main the full-stack IoT software program improvement efforts throughout cell and cloud. Earlier than becoming a member of BISSELL, he lead groups in aviation and delivered progressive digital options for civil and navy purposes. He’s additionally labored cross-functional roles in IT, enterprise improvement and program administration. Aaron is keen on using the most recent applied sciences to resolve a few of life’s most tough issues.|