Retisio

Winning in the Age of Digital Disruption

Reactive Systems to the Rescue

By Preetham Shetty
Published on November 30, 2020

Content

 

FOREWORD

New Pressure Points in Retail

Retailers’ interactions with customers are happening all the time, across channels, with lots of devices and endpoints. Modern retailers face new pressure points due to changes in their operational landscape.

A few are listed below.

  • New consumer expectations
  • Omnichannel journeys.
  • Online to store journeys.
  • Research products in other offline stores.
  • New customer experience
  • Operational efficiencies.
  • Modern architecture required to deal with these new issues in retail.

Why is Amazon winning the retail war?

There are multiple strategic answers to this question: be it logistics, innovation, business model, service, or product ecosystem. Let's look at this more simplistically.

  • In a world where ease, convenience, and price arekey determinators, Amazon is better at addressing these needs than any of its eCommerce competitors.
  • Businesses are still overly focused on IT expenses rather than enabling potential benefits to customers.
  • While most companies are thinking about how their eCommerce operations are faring today, very few are thinking about tomorrow, and even fewer are thinking about the long-term future.

This reactive approach towards Digital Platforms and lack of vision play into the hands of Amazon, which benefits from a unique business model that allows it to stay ahead of the curve.

Key Challenges of a Legacy Retailer

Retail brands are challenged to use cutting edge technologies like Cloud, AI/ML, microservices, Data Mesh, automation, and personalization solutions efficiently. They fall behind due to inefficient legacy platforms.

In the long run, most retailers will be unable to compete with digital market leaders and fulfil customer expectations on traditional friction points like ease, convenience, price, and delivery.

Technical Challenges Faced by Retailers

Retailers today face a lot of technical challenges in order to meet growing customer demands. These are just a few to state.

Scaling issues
Performance issues
Real-time data flow
Concurrency issues
Ripping out legacy architecture

What worked in Monoliths will not work anymore

Monoliths

CRUD

Depends on a consistent single state.

Relying on transactions

Depends on a single database.

REST

Depend on failure and consistency being handled in the database.

Distributed Applications

Events

Events convey facts. Facts remain true regardless of what else happens in the system.

At least once messaging

Ensures that the events can be reliably propagated throughout the system.

Stream Centric View

Our data is the event, some may be at rest, others are in motion.

No Single State

Rather systems are constantly converging, propagating, and messaging based.

Nature of Modern Digital Retail Systems

Retailers have to keep up with ever-changing customer expectations, maintaining customer loyalty. Customers expect a seamless buying experience. To attract customer loyalty, retailers need an experience that stands out. So many technologies exist to drive marketing and sales, operations, and customer experience, but they don’t seem to work together.

Retailers can create buyer experiences that can combat the fickle nature of the modern consumer only by:

  • Combining streamlined un-siloed data.
  • Providing seamless cross-channel customer service and marketing.
  • Creating authentic personalization.

Retailers need to modernize their customer experience and operational efficiency to meet the demand of modern retail. Listed below are a few benefits of adopting modern architectural approaches.

  • Modern systems can perform at peak with no downtime and handle high load with minimum infrastructure.
  • Systems can scale up and down based on load easily.
  • System components are loosely coupled and isolated with location transparency.
  • Data is distributed and eventually consistent.
  • Application is distributed, deployed across nodes, properly load balanced, without a single point of failure.
  • Modernized applications are cloud-native.
  • Modern well-designed systems are extensible. Features can be added, enhanced, and deployed without impacting the rest of the system.
  • Reduced dependencies between components, which enables feature teams to work autonomously and deliver continuously.
  • Components of different nature demand different types of data stores.
  • Many new-age features like real-time analytics, ML based recommendation, and Internet of Things (IoT) integration require the capability of stream processing of data.

Mega-trends Influencing Digital Transformation

  • Big Data
  • Cloud Computing
  • Internet of Things (IoT)
  • Mobile Business
  • Artificial Intelligence/Machine Learning (AI/ML)

Evolution in Programming Paradigms

EvolutioninprogrammingParadigms

Evolution to Reactive Systems

Evolutiontoreactivesystem

Yesterday -> Today: Some Fundamental Changes Over the Past 10 to 15 Years

Yesterday

  • Single Machines
  • Single Core Processors
  • Expensive RAM
  • Expensive Disk
  • Slow Network
  • Few Concurrent users
  • Small data sets
  • Latency in seconds

Today

  • Clusterof Machines
  • Multicore Processors
  • Cheap RAM
  • Cheap Disk
  • Fast Network
  • Lots of Concurrent Users
  • Largedatasets
  • Latency inmilliseconds

Omnichannel

To fulfil your customer’s expectations about omnichannel, you must integrate every piece of information about products, pricing, promotions, shipments, stocks, and orders, and keep it up to date. Microservices are great for such an evolutionary approach. This document will describe in detail the key differentiator that makes reactive microservices a perfect choice for retailers, who want to modernize their eCommerce infrastructure.

ominichannal
 

REACTIVE SYSTEMS

Reactive-system-digram

Using an asynchronous, non-blocking, message-driven approach, highly resilient, and elastic systems can be formed, resulting in a consistently responsive user experience.

Reactive Manifesto

blog_rect-responsive

Responsive

High-performance, providing instant feedback based on user and API interactions in all circumstances. So that means that Reactive systems need to be responsive under load at peak periods.

blog_rect-elastic

Elastic

Able to scale up and down predictably and elastically, on-demand, across cores, nodes, and clusters.

blog_rect-resilient.svg

Resilient

Self-healing, recovering, and repairing themselves automatically for seamless business continuity.

blog_rect-messagedriven.svg

Message-driven

Processing messages in parallel, asynchronously, without blocking, ensuring loose coupling, isolation, and location transparency.

"Walmart Boosts Conversions By 20% with Reactive Platform”

Modeling complex, highly concurrent software systems without using locks, threads, race conditions. Ensuring that developers working on isolated, autonomous, event-driven systems where their changes aren’t at risk of causing cascading failures that bring down an entire system require a modern tech stack and agile processes to be defined.

Why Reactive Systems?

Primary Benefits of Reactive Systems

  • Improved system performance.
  • Reduced infrastructure footprint.
  • Protected from the risk of expensive downtime.
  • Able to scale elastically when needed.
  • Flexible and scalable stack.
  • From monolith to distributed microservices.
  • Clean “Message-driven” model.
  • Event sourcing and CQRS by default.
  • Intelligent self-healing.
  • Highly performant & responsive.
why-reactive-system

Developer Productivity

Reactive Systems allow teams to be just as scalable as the technology itself. LinkedIn scaled up its engineering teams from ~50 to ~500 individuals. They couldn’t have done that if they’d needed complex coordination and cooperation amongst teams developing their systems.

Developer Velocity

Customers coming from a more traditional software development approach are surprised by how fast deployment is when working with the Reactive Platform. Going from a release every one or two weeks to deploying dozens of times a day is not uncommon. Releases that used to take hours, days or longer now happen in minutes.

New features are built and shipped fast, allowing organizations already dominant in a business area to stay dominant, defending their territory against smaller, more agile competitors.

Decrease in Infrastructure Cost

PayPal processes over one billion streaming events per day on just 8 VMs, whereas earlier, they needed over 100 VMs.

T-Mobile in the US moved from using 144 machines, each processing 13,000 messages/second, to just 12 machines, each processing 5 million messages/second.

Reactive Systems provide opportunities for dramatic cost savings on infrastructure.

At least 50% of infrastructure reduction is reported by all customers and most experienced significant improvement. This is due to the asynchronous, non-blocking, message-driven nature of the underlying Actor Model runtime of Akka.

Elasticity

Zalando scales 100x every day to support the system load brought about by their daily sales promotions. Then they scale back down when the sales are over and use only the infrastructure required to support the current load. Zalando’s business model would be completely unaffordable with a more traditional development approach.

Reactive Systems can scale to a degree that, until now, simply wasn’t possible.

Resilience

Verizon chose to rebuild their customer-facing system with Play and Akka after experiencing regular outages during high-load events, like iPhone launches and Black Friday. They expected 43 million customers to upgrade to the new iPhone after the launch, and they mandated zero downtime. Their new system has experienced no downtime at all since its launch.

Walmart Canada also experienced outages at vital times until they bolstered critical parts of their system with Reactive technology. They experienced their first Black Friday without any downtime and needed ~50% less infrastructure.

Reactive Systems can self-heal and continue operating in the face of inevitable failures that occur in production environments.

Responsiveness

  • Verizon was able to increase responsiveness to its customer’s way beyond the industry average of 6 or 7 seconds. They cut response time to just 2.4 seconds.
  • Walmart Canada supports millions of requests per hour they receive from customers with ease.

Increasing Resilience and Elasticity naturally increases responsiveness. No matter what is happening, your system can respond in a meaningful way to users. This responsiveness means users continue to trust your application. Even if their experience degrades in some way, no failure affects the entire system

Total Cost of Ownership (TCO)

There are several reasons why Reactive Systems offer a reduction in TCO compared to traditional systems.

  • Reducing infrastructure costs and increasing responsiveness.
  • Reducing the frequency and impact of failure.
  • Increasing Time-to-Value and launching new features more quickly.
total-cost-ownership

Reactive - The Right Approach

We live in a world where we need to respond very quickly to users. To meet the needs of a modern digital retail solution, the platform needs to be Cloud-native, API-first, Reactive, Events-first, Domain-driven Design, Distributed, and Microservices based.

Reactive-TheRightApproach
 

REACTIVE MICROSERVICES

“Zalando Reaches Past $3 Billion in Sales amid 100x Traffic Spikes Using Reactive Platform”

A variety of competing technologies claim to offer a fast path to microservices. However, decomposing a traditional application into individual services does not guarantee that you will realize all of the desired benefits. Reactive Microservices run in a distributed environment where network, hardware, and software failures are everyday occurrences. A microservice system can succeed initially, only to fail under increased load or unexpected spikes.

For systems with demanding requirements, RETISIO recommends Reactive Principles as the best way to design a system that copes well with uncertainty.

Reactive Principles, as defined in the Reactive Manifesto, include the properties of being responsive, resilient, elastic, and message-driven.

Characteristics of Reactive Microservices

When designed with Reactive Principles, microservices have the following characteristics:

Isolation:
Each microservice is completely decoupled. Its lifecycle, including failure, has no impact on other microservices in the system.

Autonomy:
Each microservice acts and makes decisions independently and publishes its behavior through an API.

Single responsibility:
Each microservice does one thing and does it well.

Event-driven:
A microservice produces, consumes, and reacts to events.

Mobility (and addressability):
A microservice can be moved at runtime and can be reached in the same way regardless of its location.

Characteristics-of-ReactiveMicroservices
“Distributed, Reactive Systems Unlock Higher Cloud ROI”
 

EVENT-DRIVEN ARCHITECTURE

“With asynchronous, event-driven architecture, you can simply “Let It Crash”

Event thinking is a cultural change that sets organizations ready for genuine digital business innovation

Definition

Event thinking is the approach to conceptualizing (thinking of) and implementing business solutions, where business activity is driven by event notifications and the first priority of business is to sense the business context and assess the appropriate response options in business real time.

With event thinking, the primary differentiating role of IT shifts from business data guardian to a business "nervous system"; the business shifts to the always-sensing and always-ready digital-business-native mode of operation.

Event-driven-architecture-definition

Foundations for a Real-time Enterprise

  • Data-centric: able to process large amounts of data in real-time.
  • High performance
  • Able to scale up and down elastically
  • Fully resilient and self-healing
  • Able to make efficient use of all the compute resources available
  • Having a cloud-style infrastructure alone is not sufficient. The applications that run in this infrastructure must be built using a modern, cloud-native, data-centric architecture.
Foundations-for-a-Real-time-Enterprise

CQRS

CQRS

CQRS stands for Command Query Responsibility Segregation. At its heart is the notion that you can use a different model to update information than the model you use to read information.

Powerful, native persistence strategies like Event Sourcing and CQRS supported by Apache Kafka, Apache Cassandra ensure data consistency across your clusters.

CQRS Order Flow

CQRS-order-flow

EVENT SOURCING

“Do not save the State, save the Event. In an event-sourced system, the state is transient and the event is persistent”

The fundamental idea of Event Sourcing is to ensure that every change to the state of an application is captured in an event object. These event objects are themselves stored in the sequence they were applied, for the same lifetime as the application state itself.

To see how event sourcing works, consider the Order entity in a typical Order Management Process. Traditionally, each order maps to a row in an ORDER table along with rows in another table like the ORDER_LINE_ITEM table. But when using event sourcing, the Order Service stores an Order by persisting its state-changing events: Created, Approved, Shipped, and Cancelled. Each event would contain sufficient data to reconstruct the Order’s state.

Using a Process Manager to coordinate work between multiple services

Using-a-process-manager

Benefits of Event Sourcing

  • Native audit trial
  • Historic state management
  • Distribution support
  • In-Memory processing
  • Alternate history

The flow of commands and events in the payments service.

Theflowofcommandsandevents
 

CLOUD-NATIVE ARCHITECTURE

“Get Ready for Scale with Cloud Native Architecture – Thanksgiving, Black Friday, Cyber Monday, Holiday Pricing, etc…”

What is Cloud-native?

what-is-cloud
  • Cloud-native is an approach for building applications as microservices, and running them on a containerized and dynamically orchestrated platform. It fully exploits the advantages of the cloud computing model.
  • ARC is built from ground-up to get deployed in public, private, and hybrid clouds.

Cloud-native Design Principles

  • Designed as Loosely Coupled Microservices
  • Developed with Best-of-breed Languages and Frameworks
  • Centered around APIs for Interaction and Collaboration
  • Stateless and Massively Scalable
  • Resiliency at the Core of the Architecture
  • Packaged as Lightweight Containers and Orchestrated
  • Agile DevOps & Automation Using CI/CD
  • Elastic: Dynamic scale-up/down

Element of a Cloud-native Platform

Elementcloud-nativeplatform
 

CONCLUSION

A variety of competing technologies claim to offer a fast path to microservices. However, decomposing a traditional application into individual services does not guarantee that you will realize all of the desired benefits.

“Synchronous REST turns microservices back into monoliths”

If you are breaking down a monolithic legacy application into a set of microservices, and if those microservices are communicating via REST (Representational State Transfer), then you still have, in effect, a monolithic application.

For systems with demanding requirements, ARC recommends Reactive Principles as the best way to design a FUTURE READY SYSTEM. Reactive Principles include the properties of being responsive, resilient, elastic, and message-driven. The trend towards using a microservices-based architecture for systems design is significant and it is happening for good business reasons. By having small, discrete components that can be developed, deployed, and scaled independently, microservices-based applications can take advantage of cloud economics. Developers can build and deploy services much more rapidly.

Microservices aren’t easy. We’ll help you get it right for the greatest gain.

About the Author

author-user--image

Preetham Sheetty

Strategist on all things Digital. A technologist who covers many areas like Digital Strategy, Product Development, Business Enablement - Preetham brings 15+ years of leadership experience in building complex digital commerce solutions for large enterprise retailers like Sam’s Club, Wal-Mart, Verizon, Kohl’s MetroPCS, Maritz.

Preetham’s forte is in Bridging gaps in strategy, domain & technology, and setting up a framework for new products and innovation, which has enabled him to provide Product leadership at RETISIO Inc.

Get in touch with us

We are eager to discuss your business needs and answer any questions you may have. Enter your details and we will get back to you shortly.


+1 888-627-7657

sales@retisio.com