Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Daniel Krook edited this page Mar 5, 2018 · 3 revisions

Serverless reference architecture with IBM Cloud Functions (powered by Apache OpenWhisk)

This wiki contains the getting started content posted to both the IBM Cloud console and the IBM Code Pattern site.

IBM Cloud tile title and description

Respond to messages and handle streams Create auto-scaling actions that execute logic in response to messages or streams.

IBM Code intro

Serverless platforms like Apache OpenWhisk provide a runtime that scales automatically in response to demand, resulting in a better match between the cost of cloud resources consumed and business value gained. One of the key use cases for OpenWhisk is to execute logic in response to events, such as messages or new streams of data.

IBM Code overview

This project shows the power of serverless, event-driven architectures to execute code in response to messages or to handle streams of data records.

It demonstrates two OpenWhisk actions (written in JavaScript) that read and write messages with Message Hub (based on Apache Kafka). The use case demonstrates how actions can work with data services and execute logic in response to message events.

One action receives message streams of one or more data records, and these are in turn piped to another action in an OpenWhisk sequence (a way to link actions declaratively in a chain). The second action aggregates the message and posts a transformed message to another topic.

IBM Code flow and diagram

  1. The developer simulates a client publishing application and puts a new array of JSON objects onto a topic.
  2. The message, in turn, fires an event called a trigger tied to that topic.
  3. This trigger is mapped to the first action by a rule, which downloads and parses the message array.
  4. The message array is then sent to another action in a sequence to aggregate, or reduce, the data to a single message.
  5. The second action posts the new message to another Message Hub queue for another application to process.

IBM Code components

  • OpenWhisk
  • Message Hub

IBM Code technology

  • OpenWhisk
  • Message Hub

IBM Code links

  • What makes serverless architectures so attractive? - Serverless architectures are one of the hottest trends in cloud computing this year, and for good reason. There are several technical capabilities and business factors coming together to make this approach very compelling from both an application development and deployment cost perspective.

  • Build a cloud native app with Apache OpenWhisk - At this live coding event, Daniel Krook provides an overview of serverless architectures, introduces the OpenWhisk programming model, and then deploys an OpenWhisk application on IBM Bluemix, while you watch, step-by-step.

Accelerate blog post

Analyze streaming Message Hub records with OpenWhisk

In many of today's cloud-native applications, data is generated at huge volumes and is used to link highly distributed services. Apache Kafka provides a system to stream messages at scale, but the systems that receive those messages must be able to process and act on individual records as well.

With an event-driven architecture built on OpenWhisk, you can write functions that respond to messages from queues and execute logic to process or send data to other systems in a distributed architecture. And you'll pay only for the resources consumed by your analytics functions for the fractions of a second that they run. This gives you a tight match between transactions processed and cloud resources used.

This is the promise of an event-driven, serverless architecture for new cloud-native applications such as those that support high volume stream-based message processing. Check out the new OpenWhisk demo on responding to Message Hub records and start processing messages at scale, not worrying about whether you'll have enough servers manage the volume.

Clone this wiki locally