Skip to Content

Amazon OpenSearch Service

OpenSearch Service for search and log analytics, managed domains and OpenSearch Serverless, and the common patterns for feeding it from DynamoDB, CloudWatch Logs and Kinesis.

What it is

Amazon OpenSearch Service is the successor to Amazon Elasticsearch Service. It runs OpenSearch (and legacy Elasticsearch up to 7.10) for search and analytics.

  • DynamoDB queries only by primary key or indexes. OpenSearch can search any field, even partial matches (full-text search, "contains", fuzzy matching).
  • It's common to use OpenSearch as a complement to another database: the database keeps the data, OpenSearch makes it searchable.
  • Two modes: a managed cluster (a domain) or OpenSearch Serverless (collections, no cluster to size).
  • Data in from Data Firehose, AWS IoT, CloudWatch Logs, and OpenSearch Ingestion pipelines.
  • Security through Cognito and IAM, KMS encryption at rest, TLS in transit.
  • Comes with OpenSearch Dashboards for visualization.
  • Use cases: search boxes on websites and apps, log analytics, real-time application monitoring, security analytics.

Updated since the slides

The slides say OpenSearch doesn't natively support SQL and needs a plugin. OpenSearch Service includes SQL (and PPL) query support on every domain running OpenSearch or Elasticsearch 6.5 or later, alongside its native JSON query language.

Pattern: DynamoDB + OpenSearch

OpenSearch with DynamoDB: changes to a DynamoDB table flow through DynamoDB Streams to a Lambda function that indexes the items in OpenSearch; the application searches any field in OpenSearch, then gets the full item from DynamoDB by its ID OpenSearch with DynamoDB: changes to a DynamoDB table flow through DynamoDB Streams to a Lambda function that indexes the items in OpenSearch; the application searches any field in OpenSearch, then gets the full item from DynamoDB by its ID

Search in OpenSearch, read the item from DynamoDB.
  1. The application writes items (CRUD) to a DynamoDB table.
  2. DynamoDB Streams captures every change, and a Lambda function indexes it in OpenSearch.
  3. To search, the app calls OpenSearch ("products containing wireless") and gets back the matching item IDs.
  4. It then retrieves the full items from DynamoDB by ID.

Today, an OpenSearch Ingestion pipeline with the DynamoDB plugin can replace Streams + Lambda: a managed zero-ETL sync (it uses DynamoDB Streams, and point-in-time recovery for the first full copy).

Patterns: CloudWatch Logs and Kinesis

Four ways to send data to OpenSearch: CloudWatch Logs through a subscription filter to a Lambda function (real time) or to Firehose (near real time), and Kinesis Data Streams to Firehose (near real time) or to a Lambda function (real time) Four ways to send data to OpenSearch: CloudWatch Logs through a subscription filter to a Lambda function (real time) or to Firehose (near real time), and Kinesis Data Streams to Firehose (near real time) or to a Lambda function (real time)

Lambda for real time, Firehose for near real time.
  • CloudWatch Logs → subscription filter → Lambda (managed by AWS) → OpenSearch: real time.
  • CloudWatch Logs → subscription filter → Data Firehose → OpenSearch: near real time (Firehose buffers).
  • Kinesis Data Streams → Data Firehose (optionally transforming data with Lambda) → OpenSearch: near real time.
  • Kinesis Data Streams → Lambda (custom code) → OpenSearch: real time.

Real-world examples

  • An online shop keeps its catalogue in DynamoDB and indexes it in OpenSearch, so shoppers can type "red runn" and find "Red running shoes".
  • An operations team streams application logs from CloudWatch Logs to OpenSearch through Firehose and explores errors in OpenSearch Dashboards.

Exam tips

  • "Search any field", "full-text search", "partial matches" → OpenSearch.
  • "Make DynamoDB data searchable" → DynamoDB Streams + Lambda (or OpenSearch Ingestion) to OpenSearch.
  • "Real-time log analytics and dashboards" → CloudWatch Logs subscription filter to OpenSearch.
  • "Near real time, managed, no code" → through Firehose. "Real time" → through Lambda.
  • "Elasticsearch on AWS" → Amazon OpenSearch Service.

Common traps

  • "Use OpenSearch as the primary database." It's usually a search index next to the real data store.
  • "Firehose delivers in real time." It's near real time (buffered); Lambda is real time.

Check yourself

An OpenSearch domain costs about $0.04 an hour for the smallest instance and is often forgotten, so instead:

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt