Announcing the general availability of the Cloud Object Storage event provider for IBM Cloud Functions.
Many IBM Cloud customers have been building applications that use Cloud Object Storage (COS) for data archiving, backup, mobile, and cloud-native applications. COS provides users cost-effective, scalable storage for analytics and a broad range of cloud-native workloads. Batch use cases where all the objects in an object storage bucket are processed are common. Additional use cases that rely on processing changes as they happen were not possible without polling until today.
We are happy to announce the general availability of the COS event provider for IBM Cloud Functions. The provider is initially available in our US South, Washington DC, and London regions, with deployments to Frankfurt and Tokyo rolling out over the coming weeks.
The event provider is available to users via a new trigger that can be set up using the UI or CLI of IBM Cloud Functions. The object storage docs for Functions have been updated to include information on how to get started using the new trigger today.
Hello, Serverless
Programming languages like Python, Javascript, etc. all have their own version of “hello, world”—that first example to introduce new developers to the language.
The serverless example of “hello, world” is a function that responds to an event, and the most popular event example is invoking a function when data changes.
Object storage is the de facto standard for structured and non-structured data storage in cloud-native applications. Images, documents, and streaming data enable a broad set of use cases:
- Data ingestion and cleansing
- Map/reduce jobs
- Image auto-sharpening
- Thumbnail generation
- Object detection in videos or images
- Model inferencing for signature validation in scanned docs
- Transcribing audio files with ML models into text
- Video transcoding
The COS trigger type lets you run custom code logic when a new object is stored, updated, or deleted from a designated bucket in COS. You associate a COS bucket with an IBM Cloud Functions action; when there is a change to an object in the bucket, the Function action is called. The action can be written in any programming language, Docker container, or binary executable that leverages the Cloud Object Storage SDK. Information about the object being modified is passed into the Function. In addition, the function code has access to the object storage bucket itself, so it can read and write objects.
Using the Cloud Object Storage trigger
The docs have a step-by-step description of how to get started. This is just a summary.
Before creating the trigger, you must have a Cloud Object Storage instance and at least one bucket defined. Your Cloud Functions namespace needs to have the Notifications Manager role assigned to it as well.
Create a trigger using the Cloud Functions UI or CLI. Besides the trigger name, you can specify whether you want the trigger to fire on write, delete, or both events. The default is to fire the trigger on all write, update, and delete events in the bucket.
Write the action (function) you want executed when the trigger fires. Again, these actions can be written in any programming language, Docker container, or binary executable that leverages the Cloud Object Storage SDK. NodeJS and Python developers can optionally use the built-in Cloud Functions package to process COS trigger events.
Connect the trigger just created to the action using the UI or the CLI.
Done! Now you can test your trigger and action.
The value of serverless functions
Adding a trigger on a COS bucket only requires a few steps and enables a cost-effective and time-efficient compute option for your cloud-native data. Your functions execute in a truly serverless fashion. Code is only deployed and executed when an event happens. Functions execute in parallel and scale based on the number of events coming in.
See the Function’s system details and limits page for details on how many concurrent functions you can have, their execution limits, etc. These are out of the box limits—contact us if your account needs a modification to these fixed limits.
Learn more
We are all excited about this new integration between IBM Cloud Object Storage and Cloud Functions and the use cases it unlocks.