[Music] Welcome to “Serverless Reference Architecture
and Use Cases” After watching this video, you will be able to: Describe how serverless supports a microservices architecture, identify key serverless use cases for data processing, massively parallel compute, and stream processing workloads. The most common use for serverless today is to support microservices architectures. The microservices model focuses on creating small services such that each service performs one job. Those services communicate with each other using APIs. While you can use either PaaS or Containers to build and operate microservices, serverless easily plugs into the single-task microservices architectural model. Also, serverless provides inherent and rapid provisioning, automatic scaling, and a pricing model that never charges for idle capacity. Use cases especially suited for serverless include data processing, massively parallel compute, and stream processing. Serverless is well-suited to working with structured text, audio, image, and video data—including transcoding videos to play on multiple device types, PDF processing, thumbnail generation, and image object character recognition, commonly referred to as OCR. OCR is taking an image of text, such as a scanned receipt—and converting the image into machine-encoded searchable, editable text. Consider again the scenario where you upload a profile picture to a website. The website might also require a thumbnail of that image for display on specific web pages. When a user uploads a photo to the site, this image is uploaded to an object storage bucket. This event triggers an IBM Cloud function that takes uses the uploaded image and creates the thumbnail image. The function also stores the thumbnail image in object storage so that when needed, the website can access the thumbnail image. Processing the image for other purposes, including facial recognition, is also possible. Any kind of parallel task is very well-suited for serverless runtime. Each parallelizable task results in one action invocation. Serverless is ideal for: MapReduce operations, Web scraping, Monte Carlo simulations, Genome processing. Serverless can even combine a parallelization use case with a data processing use case. For example, you saw how functions work to capture images for use on the Web. In this instance, a data processing use case with a parallel processing use case. The serverless function generates thumbnail images and creates those thumbnail images scaled quickly and in parallel. In another example, let’s say that a collection of 10,000 museum images are stored in object storage. If you want to generate thumbnails for each image, this scenario is incredibly well-suited for serverless for several reasons. First, this scenario is likely a one-time or sporadic occurrence, so continually running an application to do this doesn’t make sense. Furthermore, an action can handle each thumbnail generation. Monte Carlo simulations are mathematical methods that have been around for more than a century; and are used to estimate certain hard-to-predict future outcomes. Monte Carlo simulations are perfect for a broad range of scenarios, from weather forecasts to complex financial predictions. The displayed example attempts to predict stock prices for a specified number of days. The predict function runs several forecasts, each forecast predicting a specific number of days, and the Combine function summarizes the results. Since Monte Carlo simulations benefit from more sampling, running multiple forecasts improves the model. Each forecast runs as an independent function invocation, which accelerates the process. Combining managed Apache Kafka with FaaS and database and object storage offers a robust foundation for real-time buildouts of data pipelines and streaming apps. These architectures are ideal for working with all sorts of data stream ingestions for validation, cleansing, enrichment, and transformation. Applications of this use case include IoT sensor data, log data, and financial market data. Most internet of things devices generate data that needs to be processed. For example, a smart speaker in your home listens for verbal commands and takes actions accordingly. In this example, the processing of the user’s audio and the execution of any needed function can handle any required actions. When a user speaks, and the speaker captures the audio, that event triggers a function that uses verbal recognition software running in the cloud to analyze the request. Another function could also execute to perform the user’s requested action. In this video, you learned that: Serverless computing works well with microservices because services should perform a well-defined task and communicate via APIs. Serverless is effective for data processing, massively parallel compute operations, and stream processing workloads.