Under the hood of Staples' build-over-buy CX transformation - a Couchbase microservices story

Jon Reed Profile picture for user jreed July 18, 2019
Summary:
We hear an awful lot about "transforming customer experience" these days, but it's rare to get a look under the architectural hood. In this diginomica exclusive, I share what I learned from Staples' CX push - and how Couchbase and microservices tie in.

customer experience steps

Sure - every business wants to get closer to their customers. But how do you pull that off? Packaged cloud applications? Yes, perhaps - though the build versus buy debate is intensifying again. Staples' Pavan Kumar Prathivadi Bhayamkaram takes on that challenge every day.

As Manager, Software Engineering & Architecture at Staples, Bhayamkaram plays a key role on the technical side of Staples' digital transformation. Recently, he gave me an inside look at how his team is building their own digital platform - with customer needs as their obsession.

Technical debt - a barrier to digital transformation

But if the focus is customer experience, why does the tech infrastructure matter? Because business activities like mergers and acquisitions create problematic tech complexity. As Kumar told me:

With a new generation of customers becoming our new customers, there is a lot of complexity that gets built into this. In some cases, that's a process complexity, in some cases that boils down to a technology complexity.

If your IT team is serious about digital transformation, then technical debt is an obstacle:

The problem we have addressed is the complexity as a result of technical debt, or some of the systems not aligned in proper positions. That was preventing us from providing that channel-agnostic experience to our customers - in the context of inventory and delivery promise.

Bhayamkaram joined Staples in 2013. Over the years, he got involved in Staples' core IT projects. But how did their digital transformation pick up steam? Bhayamkaram told me changing business conditions are driving Staples' push, including an increased focus on B2B:

We already have B2B presence, and we are expanding. We had a bunch of mergers and acquisitions in the past 12 to 18 months. With all of these things mixed on top of all the complexities we handle with our technology and IT systems, it's high time to look at everything we do.

The next digital transformation challenge? Prioritizing. Bhayamkaram manages a team of engineers tasked with building "next-gen inventory, fulfillment and delivery systems." That supply chain framework must, in turn, support a range of B2B and B2C businesses. So where do you start? With the customer:

We have identified various opportunities within the scope of digital transformation. The first and foremost thing that we wanted to address was the customer experience aspect.

Wherever customers touch the business, that's fair game:

Customers shopping on all of our ordering channels, and customers getting visibility into the inventory - their order history, their last mile delivery. These are some of the high priority use cases we started working in the last year.

Contrary to the "front office" hype I hear at CX events, customer experience and back office systems are actually inseparable:

In some cases, customers have placed orders on one of our websites - and they are expecting a delivery to happen. Just because a customer has walked out of our compound doesn't mean we are no longer obliged to keep them up to date on what's going on with their order.

And that means real-time inventory visibility - across all channels. Goodbye, batch processing.

"We wanted to solve the entry point for the customer"

So where do you start?

Within the scope of the customer experience problem, we wanted to solve the entry point for the customer. As in: the customer shopping on our website, our mobile app, or in-store retail kiosks.

The goal?

We wanted them to have a consistent, seamless, and transparent experience when it comes to product inventory availability, and the customer order delivery promise.

A laudable goal - but easier said than done. Technology moves fast:

We have been pioneers in next day delivery, leveraging our own fleet for more than a decade. Other businesses and retailers are catching up now, but that's one of our selling points.

Customer demands shifted. Staples responded by pushing from single to multi-channel, but: they accumulated some IT tangles along the way.

When we look back from the technology lens, in this process of meeting that experience, we incurred a lot of technical debt. And as we look forward to the next year of providing a unified, channel-agnostic experience, it is high time that we revisit the way we do things.

Modernization - the build-over-buy case

So Bhayamkaram's team started with customer touch points and worked their way backwards, in search of back end log jams and opportunities. Their guiding question:

Is this a process issue, a system issue or an application issue? Can we solve it, or do we need to modernize the solution?

First, frame the problem: we're talking about a supply chain network including 1,300 stores, Staples fulfillment centers, and third party dropship vendors. Then add in the pressure for real-time data: you can't give customers proper visibility if your inventory numbers aren't current - across every channel. Monolithic applications don't make the cut anymore:

We had, in some cases, redundant applications doing the same job, causing that inconsistency or out-of-sync scenarios. In some cases, we have monolithic applications which are not super-flexible. All of this adds up to preventing us from providing that frictionless and seamless experience.

So, eight months ago, Bhayamkaram's team leaned into their modernization efforts, starting with their B2C businesses. They quickly realized that build - not buy - was their way forward:

As this is a fast changing, volatile market, we decided we shouldn't be looking at vendor software in this case. After a lot of research and evaluation, looking at various options, we decided that to provide that personalized experience, we've got to build the product using our own knowledge, with open-source technologies and everything that you can imagine.

And that's how Staples' CX ambitions led to a new tech architecture:

We decided to build a new microservices architecture, leveraging Couchbase as our data store with a variety of open source technologies - and a variety of software design patterns bundled into the functional element of that service.

That also means process changes:

We have to do a variety of changes to meet that bar of providing a personalized experience. We have converted a variety of offline processes that we have been doing traditionally with our monolithic applications. We converted them to an online process, and all of our batch processes have been translated into event-based triggers or data streams.

From monolithic apps to Couchbase microservices

I often get asked why microservices are relevant. Fair question - we should always push back against trend-happy buzzwords. Here's how Bhayamkaram explains it:

We did leverage a variety of open source technologies like Apache Kafka. We have also broken down monolithic applications into lightweight microservices which are self-contained, which are fault-tolerant and resilient. We have built all that intelligence and smartness to auto-heal themselves, and secure themselves.

Bhayamkaram's team evaluated a number of technology stacks and NoSQL databases. So why did Couchbase stand out? Given the need to support customer-facing apps, they looked at issues like availability and persistency. They did not want to have to add a caching layer on top of their data store.

When we looked at all the data persistence layer prerequisites, Couchbase sounded like a great fit. Couchbase is our best choice that we made - they are great partners to us. They have helped us a lot towards this journey. They have supported us a lot, making sure that all of our requirements are met: the high throughout, low latency, and our SLA requirements.

There's more to this new stack. Beyond the Couchbase data store level, there is SpringBoot on the client-server side, and a microservices architecture utilizing Netflix Open Source Stack, and the Spring Java framework (which is sponsored by Pivotal). Then there are the algorithms:

We did leverage a variety of mathematical formulas that are required to provide product availability based on customer destination addresses.

To get omni-channel right, real-time responsiveness is everything. Bhayamkaram:

In some cases, we are required to compute and estimate customer order delivery promise on the page load, or in other cases, as the order life cycle progresses on our website or our mobile app. We are required to provide a consistent experience, and there is a lot of operational data involved in arriving at that estimated date.

The wrap - hitting the real-time inventory milestone

Bhayamkaram and team have hit their first major milestone: inventory visibility across channels, at a realistic cost.

All of this comes with a lot of cost. This data is changing almost every minute or every second...  In this case, we needed to heavily rely upon our persistence. That's where Couchbase has helped us a lot.

First big job done:

We were able to meet this milestone of providing a consistent and accurate inventory visibility, irrespective of which channel... We believe we were able to meet that channel-agnostic, frictionless experience that current day customers expect from any business.

Bhayamkaram's team had to extend real-time responsiveness across Facebook, Instagram, and about thirteen different online platforms. They also brought this visibility to indirect selling channels. As of our discussion, things were looking good:

We believe we have reached almost 99 percent accuracy in terms of the visibility that we are giving to our customers - irrespective of where they start their order journey.

That's a nice accomplishment - but Bhayamkaram knows there is huge work ahead. They are now rolling this "new customer experience" out across Staples' direct and indirect sales channels. And this functionality is just the beginning. They'll give the same attention to B2B, including the StaplesAdvantage.com B2B web site.

Early performance benchmarking on the consumer side shows promise: "With Couchbase as a data store, we were able to make a big leap."  Bhayamkaram says we're talking in the 4x milliseconds range of improvements, which is a big deal for consumers expecting quick page loads. 

Transformation underway? Check. Building on the right stack? Check that box too. But there's still the fierce retail market conditions to contend with. And there, Staples' story is far from over. It will be important to see how these changes translate into market wins. But for now, I get where Bhayamkaram's team is coming from:

This is definitely a huge milestone for all of us at Staples.

Loading
A grey colored placeholder image