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
- The application writes items (CRUD) to a DynamoDB table.
- DynamoDB Streams captures every change, and a Lambda function indexes it in OpenSearch.
- To search, the app calls OpenSearch ("products containing wireless") and gets back the matching item IDs.
- 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
- 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:
Sync the table to OpenSearch: an OpenSearch Ingestion pipeline with the DynamoDB plugin (or DynamoDB Streams with a Lambda function), search in OpenSearch, and read full items from DynamoDB by ID.
Create a CloudWatch Logs subscription filter that sends the logs to OpenSearch through the AWS-managed Lambda function (real time), not through Firehose (near real time).
AWS documentation
Amazon Redshift
Redshift as the AWS data warehouse, its leader and compute nodes, provisioned and serverless modes, Multi-AZ, snapshots and cross-Region DR, loading data, zero-ETL, and Redshift Spectrum.
Amazon EMR
Amazon EMR for running Hadoop and Spark clusters on EC2, its primary, core and task nodes, purchasing options, long-running vs transient clusters, and EMR Serverless.