Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kalix: Tackling the The Cloud to Edge Continuum

Kalix: Tackling the The Cloud to Edge Continuum

Read this blog for an overview of Kalix:
https://www.kalix.io/blog/kalix-move-to-the-cloud-extend-to-the-edge-go-beyond

Abstract:
What will the future of the Cloud and Edge look like for us as developers? We have great infrastructure nowadays, but that only solves half of the problem. The Serverless developer experience shows the way, but it’s clear that FaaS is not the final answer. What we need is a programming model and developer UX that takes full advantage of new Cloud and Edge infrastructure, allowing us to build general-purpose applications, without needless complexity.

What if you only had to think about your business logic, public API, and how your domain data is structured, not worry about how to store and manage it? What if you could not only be serverless but become “databaseless” and forget about databases, storage APIs, and message brokers?

Instead, what if your data just existed wherever it needed to be, co-located with the service and its user, at the edge, in the cloud, or in your own private network—always there and available, always correct and consistent? Where the data is injected into your services on an as-needed basis, automatically, timely, efficiently, and intelligently.

Services, powered with this “data plane” of application state—attached to and available throughout the network—can run anywhere in the world: from the public Cloud to 10,000s of PoPs out at the Edge of the network, in close physical approximation to its users, where the co-location of state, processing, and end-user, ensures ultra-low latency and high throughput.

Sounds exciting? Let me show you how we are making this vision a reality building a distributed real-time Data Plane PaaS using technologies like Akka, Kubernetes, gRPC, Linkerd, and more.

Jonas Bonér

May 26, 2022
Tweet

More Decks by Jonas Bonér

Other Decks in Programming

Transcript

  1. Are You Stuck 
 with an enterprise stack 
 where

    you have to manage 
 Everything Yourself? Load Balancer Ingress Router Cache Cache Your App Your App Event Broker Database Database Cache Cache Your App Your App Event Broker Database Database
  2. The need for Vertical Integration There are already too many

    primitives for engineers to deeply understand and manage them all, and more arrive by the day. And even if that were not the case, there is too little upside for the overwhelming majority of organizations to select, implement, integrate, operate and secure every last component or service. Time spent managing enterprise infrastructure minutiae is time not spent building out its own business. “ Stephen O’Grady, RedMonk Vertical Integration: The Collision of App Platforms and Database
  3. Civilization advances by extending the number of important operations which

    we can perform without thinking of them. “ Alfred North Whitehead
  4. Self-Managed On-Prem Application Business Logic Frameworks Database Transport Security Infrastructure

    Kubernetes Operating System Virtualization Servers, Storage, Networking In the Cloud Kubernetes Operating System Virtualization Servers, Storage, Networking Application Business Logic Frameworks Database Transport Security Infrastructure What We Need Application Business Logic Frameworks Database Transport Security Kubernetes Operating System Virtualization Servers, Storage, Networking Infrastructure From Serverless to Databaseless Managed by Cloud / Service Provider Customer Managed
  5. Edge Computing Edge Computing is actually being implemented today in

    many of our clients’ environments, […] enabling entirely new applications and data models. Simply put, Edge has moved from concept and hype into successful vertical industry implementations, with general purpose platform status approaching rapidly. “ Bob Gill 
 Gartner (Oct. 2021)
  6. The Edge is already here • Telco, Cloud, and CDN

    companies are building out the infrastructure • 5G and Local-first software is changing the game • Customers demand that we move data and compute closer to end-user— for lower latency, better availability, and more advanced use-cases • We are moving beyond edge computing—towards stateful and a holistic view on data and compute • Huge market on the rise: $4.6B in 2020 to $61.1B (CAGR 38.4%) - Gartner It’s just not fully leveraged
  7. Edge use-cases • Autonomous vehicles • Retail & E-commerce •

    Trading systems • Health care • Emergency services • Factories • Stadium events 
 (sport, concerts) • Gaming • Farming • Financial services • Smart homes • And more…
  8. Tsunami Warning • Gartner predicts that by 2025, 75% of

    enterprise-generated data will be created & processed on the Edge (10% today) • This requires: • Keeping as much data on the Edge as possible • Move processing to the Edge • Benefits: • Real-time processing, lower latency, faster answers • Resilient, not relying on stable connection to cloud • More resource efficient, less data shipping https://www.gartner.com/smarterwithgartner/what-edge-computing-means-for-infrastructure-and-operations-leaders
  9. Hierarchical Layers from Cloud to Device Opportunities and limitations Further

    out (towards devices): • 10,000s to 100,000s of PoPs to coordinate • Unreliable networks & hardware • Limited resources & compute power • Real-time, low latency processing • Needs weaker consistency/guarantees • Local, faster, less accurate decisions • More resilient & available • Requires fi ne-grained data replication 
 and mobility Further in (towards cloud): • 10s to 1000s of nodes to coordinate • Reasonably reliable networks & hardware • Vast resources & compute power • Batch, high latency processing • Allows stronger consistency/guarantees • Global, slower, but “better” decisions • Less resilient & available • Coarse-grained data replication possible, 
 data can be stationary
  10. Technical Requirements • Autonomous self-organising components • Physical co-location of

    data, compute, end-user • Intelligent and adaptive placement of data, compute, end-user • Local-first cooperation (function just fine without backend cloud) • Fine-grained and adaptive replication (row-level) • Consistency a la carte—Eventual, Causal, Strong • Options for “state models” (“shapes”)—SQL, Event Sourcing, CRDTs, 
 Views, Streaming • End-to-end guarantees of SLAs, business rules, and data integrity
  11. My vision of a • Cloud to Edge is a

    continuum • Powering location transparent services that can run anywhere 
 –from public Cloud to 100,000 of PoPs at the Edge • Should not be a design, development, or even deployment decision • Data always exists wherever and whenever needed, and only for the time it is needed • Data and compute moves adaptively, together with the end-user • Data is always co-located with processing and end-user 
 —ensuring ultra low latency, high throughput and resilience • Data is injected into the services on an as-needed basis 
 —automatically, timely, efficiently, and intelligently Cloud to Edge Data Plane
  12. Freedom is not so much the absence of restrictions as

    finding the right ones, the liberating restrictions. “ Timothy Keller
  13. Distilling the Ultimate Cloud to Edge Programming Model 1. Data

    model • How to model the business data • Its structure, constraints, guarantees, and query model 2. API • How to communicate/coordinate services and outside world 3. Business logic • How to mine intelligence, act, and operate on the data • Transform, downsample, relay, and trigger side-effects • Using work fl ow, point-to-point, pub-sub, streaming, broadcast The rest can (and should) be fully managed and automated by the underlying platform 3 things we as developers can never delegate:
  14. • Fully managed developer PaaS—for building real-time event-driven Cloud Native

    and Edge Native applications • Beyond Serverless—abstracts away ALL infrastructure into a single declarative programming model (DB, event broker, cache, API gateway, service mesh, security, …) • Polyglot—use it from Java, Javascript, Typescript, Scala, Python, Go, and more • Unifies Cloud Native and Edge Native development in a Cloud-to-Edge Data Plane • Reactive at its core—low latency, high throughput, always available, adaptive scaling, co-location of data and compute (built on Akka, gRPC, Kubernetes)
  15. Application Business Logic Frameworks Database Transport Security Infrastructure Kubernetes Operating

    System Virtualization Servers, Storage, Networking Kalix Kubernetes Operating System Virtualization Servers, Storage, Networking Application Business Logic Frameworks Database Transport Security Infrastructure Application Business Logic Frameworks Database Transport Security Kubernetes Operating System Virtualization Servers, Storage, Networking Infrastructure Vertical Integration As a Service Managed by Cloud / Service Provider Customer Managed
  16. How do you build a service? 3 2 1 State

    model API description Business logic
  17. Step 1: Define API and data service ShoppingCart { rpc

    AddItem(AddLineItem) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/ShoppingCart/cart/{user_id}/items/add", body: "*", }; } … } message AddLineItem { string user_id = 1 [(kalix.field).entity_key = true]; string product_id = 2; } option (kalix.method).eventing = { in: { event_log: "shopping-cart" } out: { topic: "shopping-cart-events" } }; Schema- fi rst: Declarative con fi guration in Protobuf
  18. Step 2: Define state model option (kalix.codegen) = { value_entity:

    { … } } rpc GetCarts(GetCartsRequest) returns (stream Carts) { option (kalix.method).view = { query: "select * from carts where userid = :userid" }; } … option (kalix.codegen) = { event_sourced_entity: { … } } option (google.api.http) = { get: "/carts" };
  19. Step 3: Write business logic // Tie the gRPC service

    to a JS function entity.setBehavior(cart => { 
 return { commandHandlers: { AddItem: addItem, } }); // Business logic function addItem(addItem, cart, ctx) { console.log("addItem", addItem); } Event State Context Event and State injected into the function Choose language and write the function
  20. State is injected into the function on an as-needed basis

    Event In User Function Deployment Event Out State In State Out
  21. If the Function manages the state, It is A Black

    BoX To the runtime The Problem
  22. In Summary Cloud development is too complex • Serverless is

    promising, but currently falls short • We need to continue to climb the ladder of abstractions • We need Vertical Integration not an integration project Edge Computing is already here • Opens up a new world of possibilities and challenges • We need to see Cloud and Edge as a continuum • Apps soon need to be both Cloud Native and Edge Native • We need to a new Programming Model and DX 
 designed to serve this Cloud to Edge continuum Kalix is here to help: • Polyglot, real-time, event-driven, reactive, zero-ops PaaS • Adaptive, resilient, and scalable Cloud-to-Edge Data Plane • Use it in the Cloud today, but be ready for future Edge use-cases