A large-scale upheaval of Argos’ Basket System from Monolithic to Microservice

Dashanuj
Sainsbury’s Tech Engineering
4 min readJul 21, 2023

The importance of a basket:

Of all the different parts of the digital ecosystem, the basket is perhaps the most crucial element to its success. Whilst there are certainly a multitude of components that all factor into the success of a company in the online space, none are more important and more vital than the basket. It can be responsible for either elevating a consumer’s experience on a website or irreparably tarnishing their perception of the company if it’s slow and clunky.

It is for this reason that as part of the Sainsbury’s group that Argos has recently undergone a monumental shift in the implementation of the digital basket from an unreliable, ineffective monolithic application to a fast, powerful set of microservices. Allowing for Argos to singlehandedly bring itself into a new age of efficiency without impeding consumer experience in the slightest, given that the transition also occurred whilst the old system was still operating.

The old system and its flaws:

The basket had been running on an old version of WebSphere Commerce Suite (WCS) — a typical monolithic application design — which has been powering the Argos environment for many years. Despite being capable of handling typical traffic patterns, it struggled when large amounts of traffic flooded the Argos site on days when large sales events took place.

As a result, events like Black Friday tended to cause site crashes and complex errors in the basket that were difficult to diagnose. Leading to a sense of immense frustration for customers looking to buy items and for developers being forced to fix the bugs in the system that kept popping up sporadically.

This all resulted in an increase in costs and loss in profits, proving that the old system had to be replaced with a new, more efficient process that would be able to handle a significant uptake in users and avoid crashing at the first sign of trouble.

The new system and its benefits:

The new basket has been built using a set of microservices that have all been linked together by Kafka. By isolating individual elements of the basket, the developer teams can easily conduct repairs and fix bugs without having to wait until there is low traffic on the site, meaning that the website is in a position to run far smoother than previously possible.

As for how it works, the system itself is made up of a series of components:

The Gateway is a Spring Cloud Gateway Microservice that uses all the Gateway functionality such as routing, predicting and filtering. If there are shopping bots that want to bring the site down, developers can easily check and predict any attacks using this new architecture, making it easier to identify and mitigate security threats. Furthermore, the Gateway possesses the ability to support multiple channels and brands, allowing the individual brands of Sainsbury’s to be able to use the same ecosystem of services.

Apache Kafka, an open-source system written in Java and Scala, has also been used for the greatest efficiency. In the past, the previous system would send a message which had to be received or it would simply get stuck (looking from an MQ perspective). With Kafka, multiple systems messages can be received at the same time, increasing the speed of the process extensively.

Finally, the database itself has changed from SQL to Dynamo-DB, significantly improving the system. Whilst newly created Schema tables were fixed and stationary in the old database (resulting in development being largely limited), the new database is Schema-free, allowing for scaling to take place with ease and backups being placed at the choice of the Amazon Web Service (AWS).

The New Basket architecture:

The migration process:

Now, obviously, this migration process couldn’t have been completed overnight. Owing to the complex nature of the transition, a “big bang” approach would likely have caused a dramatic increase of risk for failure and loss of revenue for the business.

Therefore, a phased approach was used, allowing for a gradual implementation of the new service that was able to reduce the risk and complexity of the transition process, thus ensuring that customer satisfaction was prioritised throughout the migration.

Phase 1 focused on the Web browser and the basket system on the Sainsbury’s Argos website. By specifically targeting the Web browser, this phase acted as a test run for the set of microservices, allowing the technology’s efficiency, stability and scalability to be measured with ease. During this period, the WCS basket maintained its operations as the so-called “master” basket, ensuring that the Web browser wouldn’t be left stranded if the microservices failed.

Once the necessary checks had been made, Phase 2 commenced, integrating the apps into the already established microservices basket system, standardising the use of microservices throughout Argos. At this time, operations also shifted completely from the WCS basket to the set of microservices, thus concluding the use of WCS in the Sainsbury’s Argos basket permanently and ensuring a successful modernisation of the basket, whilst also optimising it to handle the ever-increasing pressure applied by expectant customers for whom ease and efficiency are of the utmost importance.

How this new system can be used for the benefit of Sainsbury’s’ online retail sector:

With this new system in place, the different brands within the Sainsbury’s group that provide General Merchandise and Clothing (Argos, TU Clothing, Habitat) all benefit from the capabilities provided. The architecture can cater for different requirements in the basket, making the new design an adaptable, versatile system that allows for easy AB testing.

Not only does it improve the consistency of the basket, but it also improves its reliability, speed, maintainability and countless other measures, ensuring that the experience of consumers is at its most enjoyable, allowing Sainsbury’s to become closer to achieving its vision of being “the most trusted retailer, where people love to work and shop”.

--

--