Cell-based architectures and Akka, a perfect match

8 minute read

Cell-based architectures have been on the rise in recent years, driven by the need for elasticity, agility, and resilience. The rise of AI-centric applications and agentic AI is creating an even greater need for agility and increased velocity that adopting a cell-based architecture can bring. This pattern, combined with event sourcing, is a great fit for agentic systems. LLMs are inherently event-driven and introduce new challenges due to the impact of AI APIs, which are unreliable, slow, and behave unpredictably.

Prefer to download this information? Get the guide in PDF format here.

What is a cell-based architecture?

A cell-based architecture uses modular, self-contained "cells" to build systems. For building microservice applications, cells include all necessary components of your application (data, logic, memory, compute) and can be easily deployed and scaled up and down, isolating failures.

The earliest cell-based examples were in telecommunications, where the cells were building blocks for mobile networks, giving rise to the term "cellular communications" and "cell phones." In computing hardware, cell-based paradigms have been applied widely in building memory, processors, high-density storage, and compute. Container-based architectures are another example of the application of cell-based principles.

Cell-based architecture tenets


  1. Cells should be fully self-contained and modular, with failure isolation: Logic and State should be sharded or partitioned, with each logical cell having self-contained, complete state, following the bulkheading pattern (modeled after ships with bulkheads to isolate hull breaches). Cells should have fault isolation boundaries that restrict the effect of failure on other cells.
  2. Cross-cell replication: Replication between cells for both resilience and inter-cell and inter-service communication should be seamless and automated.
  3. Cell failover/failback: For resilience and disaster recovery, this should be fully automated.
  4. Local development and testing, CI/CD DevOps: Cell-based architectures enable greater velocity and agility for development teams. Developers can develop independently, locally, and deploy continuously. Cells should therefore support rolling updates and deployments without downtime.

Challenges and considerations

  • Implementation considerations — Cell-based architectures require more consideration in areas such as partitioning strategies and a deeper understanding of distributed systems, as well as using techniques like Event Sourcing, CQRS, and Sagas to solve problems properly while maintaining isolation of cells and failures.
  • Architectural and design needs — Cell-based architectures require more upfront sophistication to properly design cell-based systems.
  • Observability hurdles — Cross cell interaction in large, complex systems can make observability and tracing issues more challenging.
  • Supporting technologies —Cell-based architectures work best when combined with other architectural patterns, such as Event Sourcing, CQRS, and the Actor Model, and with automation technologies such as Kubernetes and containers, CI/CD tools, infrastructure as code, and service meshes. 

How Akka supports a cell-based architecture

Akka Platform simplifies the effort and accelerates the delivery of cell-based architecture.

Akka benefits for cell-based architectures:

  • Akka manifests the cell architecture in a very cost-effective way, both in terms of cloud infrastructure and operational effort. The Actor Model and Akka were driving forces in the global adoption of architecture patterns such as bulkheading, data locality, and event sourcing, which provide critical building blocks of cell-based architectures.
  • Akka provides high-scale, multi-region elasticity, agility, and resilience with unparalleled performance (6ms: p99 read latency).
  • Provides a highly resilient and elastic runtime architecture.
  • Minimizes operational costs and accelerates agility and velocity.
  • Enables easy cloud portability (Azure, GCP, AWS, virtual private cloud, and more).

The Akka Platform cell-based architecture

Akka Platform is the only PaaS that follows the cell-based architecture pattern by default and adds multi-region, multi-master replication, and federation. Akka services are each an independent containerized microservice comprising both application logic and data. Each service is elastic, able to scale up or down independently based on load.

key_cell_concept

Akka services are managed in application projects to create cells that enable seamless operation. Data locality with self-contained in-memory data stores ensure minimum latency and maximum throughput, while also enabling a run-anywhere approach. Cells can deploy anywhere: multi-cloud, in data centers, and at the edge.

Your application code remains unpolluted by configuration or infrastructure code. It is based on simple domain objects yet inherits the best-practice patterns built upon Akka’s 15 years of experience with highly distributed, highly elastic, event-sourced applications.

distributed_computing

Each Akka service is composed of a set of standard Akka components used in our SDK as building blocks for cell-based applications. Each Akka component is itself built upon the Actor Model, isolating resources and enabling granular levels of isolation and scaling. Individual Akka components can scale independently and elastically. Each Akka service can itself be viewed as a cell with independent deployment and operational control.

akka_components (1)

The Akka SDK requires learning six simple components, with simple, unpolluted business logic, enabling rapid ramp-up for developers, faster development, and lower maintenance effort. 

akka_services (1)

Akka service cells can deploy anywhere and continuously replicate data with each other. All communication follows the Actor Model and Event Sourcing out of the box. Developers do not need to be experts in these to get the benefits. Communication is brokerless, real-time, event-driven, and highly efficient over gRPC.

Architecture parallels

Feature Akka Platform Cell-Based Architecture
Basic Units Component (built on Actor) & Service (Services combine closely related components deployed together ) Cell
Communication Message-passing API gateways & eventing
State Management Private, encapsulated Cell-local storage
Failure Containment Supervisor hierarchies Fault-isolated boundaries
Scalability Mechanism Component replication/sharding Cell replication/partitioning

Deployment environment

Akka Platform deploys cells into one or more cloud regions, depending on the requirements of each application in terms of target regions, resilience, elasticity requirements, and more.

multi-region_replicated_cell_deployment

Akka solves this with the Actor Model and the Event Sourcing approach. State changes are captured and replicated across local in-memory databases, with persistence following an append-only approach, eliminating the need for blocking calls.

Akka Platform inherently delivers cell-based microservices architecture applications. The platform is intrinsically based on Event Sourcing and streaming, enabling processing billions of events and enabling deploying cells anywhere—whether edge, cloud, or on-premise.

With traditional cloud services and technologies, you would have to build your own framework to enable a cell-based architecture and to manage testing, deployments, and operations at scale.

Building cells with Akka

With the Akka Platform, you build apps using the simple but powerful Akka SDK, not directly with the APIs for Akka Libraries. Applications built using the Akka Platform are easier to develop (5-10x faster than with the libraries) and easier to operate.

The Akka Platform SDK makes the power of Akka accessible to a much wider community of enterprise developers and increases maintainability.

The Akka Platform SDK offers the following components, which deploy as Akka Services—microservices that deploy as elastic cells on the Akka platform—or as self-managed nodes, cells you can manage and scale yourself, deployed in your Kubernetes environment.

Stateful components

End points  — Components to define APIs

Other components

  • Consumers — for consuming and producing event streams
  • Views — for querying state from entities and workflows, following the CQRS pattern
  • Timers — for timed/scheduled actions and tasks

Summary

We have seen how cell-based architectures, particularly when combined with event sourcing and microservices patterns, support greater agility, resilience, and elasticity. The Akka Platform excels at enabling these robust cell-based architectures. Akka inherently supports the principles of cell-based design with self-contained, independent microservices featuring built-in data locality and in-memory data stores, ensuring low latency and high throughput. The platform's use of the Actor Model and Event Sourcing eliminates blocking calls, enhances fault isolation, and simplifies replication—crucial for resilience and disaster recovery.

Key strengths of Akka Platform for cell-based architectures

  • Cell-based principles: Akka applications are built using self-contained microservices with isolation and data locality
  • Fault isolation: Actor Model and Event Sourcing provide granular fault isolation and resilience
  • Resilience: Akka cell microservices seamlessly deploy to multi-region environments with up to six nines of uptime, RTO near zero, RPO=0.
  • Agility: Akka Platform and SDK simplify development
  • Elasticity: Akka services, or “cells,” consist of elastic component instances with full cloud portability, supporting multi-cloud, edge, or on-prem clusters
  • Superior performance: Low latency, high throughput

Akka is an ideal fit for applications that must integrate LLMs and other AI models due to their slow performance, event-driven nature, and the need to maintain stateful interactions—ensuring resilient applications that deliver a responsive experience.

The Akka Platform SDK further streamlines development by abstracting complexities and offering pre-built components for state management, APIs, and event stream processing. Unlike traditional cloud technologies, Akka provides a natural foundation for cell-based architectures, delivering superior resilience, performance, and developer velocity right out of the box.

I encourage you to try Akka SDK today and see how easy it is to build and deploy cell-based microservices.

When AI Needs an SLA