Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Daniel Krook edited this page Feb 14, 2017 · 19 revisions

Getting Started with OpenWhisk and Serverless APIs

This wiki contains the getting started content posted to both Bluemix and the Accelerate developer advocacy site.

Bluemix tile title and description

Build serverless REST APIs Create actions that execute logic to execute in response to HTTP REST API calls.

Accelerate intro

A new programming model is emerging for cloud-native applications that lets developers write code that responds to events, such as create, read, update, delete requests against a REST API. Platforms like OpenWhisk provide a runtime environment to manage the containers to run that code, and automate the complete create, start, stop, destroy lifecycle of the compute resources needed. This results in a better match between the cost of cloud resources consumed and business value earned.

Accelerate overview

This project shows the power of serverless, event-driven architectures to execute code in response to HTTP REST API calls. It demonstrates four OpenWhisk actions, written in JavaScript that read and write data to a database (Compose PostgreSQL?). The use case demonstrates how actions can work with data services and execute logic in response to HTTP requests.

One action is mapped to POST requests. It inserts the entity body into the data after parsing out cat name, gender, and description. A second action is mapped to PUT requests to update those fields for an existing cat in the database. A third action is mapped to GET requests that return individual cat data, or the complete list of cats. A fourth action deletes a given cat from the database.

Accelerate flow and diagram

  1. The developer uploads and invokes the first action manually, this connects to Cloudant and inserts data.
  2. The data insert in turn fires an event called a trigger. This trigger is mapped to a second action by a rule.
  3. The second action executes in response to the event, inspects the data, and logs information to the console.

Accelerate components

  • OpenWhisk
  • Cloudant

Accelerate technology

  • OpenWhisk
  • Cloudant

Accelerate links

  • TBD

Accelerate blog post

Data Processing with Cloudant – Responding to database changes in an event-driven architecture

Computing has fundamentally changed as the Internet shifts away from human driven, request/response web applications. New cloud-native microservices are more and more likely to respond to machine or system initiated events than they are to human driven HTTP requests. This trends will continue as "things" outnumber humans on the Internet.

New computing models are emerging to address this trend, one of the most interesting is called "serverless."

Clone this wiki locally