-
Notifications
You must be signed in to change notification settings - Fork 33
Home
This wiki contains the getting started content posted to both Bluemix and the Accelerate developer advocacy site.
Build serverless REST API handlers Create actions that execute logic to execute in response to HTTP REST API calls.
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 earned. One of the key use cases for OpenWhisk is to map business logic functions to HTTP REST API calls to create, read, update, delete entities.
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 MySQL database. 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.
The Node.js runtime on Bluemix provides a pre-built set of NPM modules. This demo highlights how additional Node.js dependencies - such as the MySQL client - can be packaged in a ZIP file along with custom actions to provide a high level of extensibility.
- The developer uploads and invokes the first action and then maps a route to it. When invoked, this connects to MySQL and inserts POST data.
- The developer uploads and invokes the second action and then maps a route to it. When invoked, this connects to MySQL and updates PUT data.
- The developer uploads and invokes the third action and then maps a route to it. When invoked, this connects to MySQL and retrieves GET data.
- The developer uploads and invokes the third action and then maps a route to it. When invoked, this connects to MySQL and deletes the data specified with DELETE.
- OpenWhisk
- MySQL
- OpenWhisk
- MySQL
-
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.
Creating Serverless REST APIs with OpenWhisk Building Serverless REST APIs – Responding to HTTP calls 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."