How it works...

This recipe combines and builds on the Creating a materialized view in S3 and the Creating a materialized view in Elasticsearch recipes to create a highly scalable, efficient, and cost-effective read-only view of the data in a bounded context. First, the listener function atomically creates the materialized view in S3. The S3 Bucket is configured to send events to a Simple Notification Service (SNS) topic called BucketTopic. We use SNS to deliver the S3 events because only a single observer can consume S3 events, while SNS, in turn, can deliver to any number of observers. Next, the trigger function atomically indexes the data in the Elasticsearch Domain and includes the url to the materialized view in S3.

The RESTful search ...

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.