Chapter 17 · Index Lifecycle: Elastic ILM/Data Tiers and OpenSearch ISM

Design Equivalent Retention Strategies in Elastic and OpenSearch and Document Feature/Operational Differences

Design equivalent AtlasMart retention intent in Elastic and OpenSearch while documenting non-equivalent lifecycle, tiering, policy-update, simulation, and managed-service behavior.

Intermediate → Advanced115–150 minutesLifecycle automation & retention labElasticsearch 9.5.3 · OpenSearch 3.8.0Last reviewed: September 2026

Learning outcomes

AtlasMart’s architecture board wants one retention design that can be implemented on Elasticsearch or OpenSearch. The correct deliverable is not “same JSON.” It is an intent contract plus two product-specific implementations, measurable equivalence tests and an explicit list of non-equivalent capabilities.

01

Write lifecycle requirements in product-neutral invariants before selecting ILM or ISM syntax.

02

Produce parallel Elastic/OpenSearch policy designs and document where equivalence stops.

03

Validate rollover, retention, placement, merge/shrink and delete semantics with observable evidence.

04

Define portability tests for correctness, cost, recovery, latency, permissions and managed-service boundaries.

05

Hand off lifecycle ownership cleanly to Chapter 18 snapshot/restore and disaster-recovery design.

Chapter baseline reviewed 11 September 2026

Examples target self-managed Elasticsearch 9.5.3 / Kibana 9.5.3 and OpenSearch 3.8.0 / OpenSearch Dashboards 3.8.0. AtlasMart keeps https://localhost:9200 for Elasticsearch with CA verification and https://localhost:9201 for the disposable OpenSearch demo certificate using OPENSEARCH_INITIAL_ADMIN_PASSWORD. Existing containers remain atlasmart-es and atlasmart-os. The lifecycle lab uses isolated aliases atlasmart-life-es and atlasmart-life-os, one primary shard and zero replicas so a single-node local lab can run; that topology is not production guidance. OpenSearch demo -k is local-only. No moving latest tags are used.

Lifecycle systems are not interchangeable

Elastic ILM is a phase/action engine integrated with Elastic data tiers. OpenSearch ISM is a plugin state machine with states, ordered actions and transitions. Similar goals such as rollover and deletion do not make policy JSON, policy-update timing, tier semantics, troubleshooting APIs, permissions, managed-service behavior, or feature availability portable.

Execution note

The generation environment does not run the AtlasMart Docker containers. Commands below are reproducible lab instructions, while response snippets are explicitly labeled expected shapes/invariants rather than fabricated measurements. Measure your own transition timing, I/O, CPU, merge time, p95/p99 search latency and storage consumption.

1. Start with the AtlasMart intent contract

Invariant Acceptance rule
write continuity clients always write through stable logical target; rollover changes physical generation without application downtime
bounded generation rollover threshold derived from measured recovery/search limits; no universal shard-size folklore
read-mostly optimization shrink/merge-like work only after generation is no longer active write target and resource budget is available
retention delete only after 30-day example intent plus compliance/hold/recoverability gates
observability controller state, action error, allocation, disk/merge/recovery and latency evidence retained
rollback policy version and prior implementation retained; destructive actions have separate approval gate

2. Equivalent intent, product-specific implementation

Intent Elastic 9.5.3 OpenSearch 3.8.0 Not equivalent because…
lifecycle model hot/warm/cold/frozen/delete phases user-defined states and transitions control vocabulary and update semantics differ
rollover ILM rollover on data stream or rollover alias ISM rollover on managed index with rollover alias prerequisites data stream integration and alias prerequisites differ
tier movement data tiers + tier preference/migrate action allocation attributes / OpenSearch-specific storage/search modes Elastic tier roles are not generic ISM states
policy update version increment + cached phase definition policy OCC + asynchronous change-policy semantics running-definition propagation differs
preview test fixture + explain ISM simulate API plus explain OpenSearch has explicit mutation-free policy simulation
error recovery explain ERROR + retry; move-to-step exceptional explain/validation + retry; change-policy available failure state and intervention APIs differ
serverless/managed Elastic Serverless uses data stream lifecycle, not self-managed ILM Amazon OpenSearch Service/Serverless features/config differ from upstream managed control planes abstract or restrict lifecycle features differently

3. Portability test suite

Intent-level acceptance tests
TEST rollover_write_continuity:
  ingest through logical target during/after rollover
  assert no client physical-index dependency

TEST retention_scope:
  enumerate candidate generations
  assert only approved prefix/data stream is managed
  assert delete state is unreachable before compliance gate

TEST read_only_compaction:
  assert old generation is not write index before shrink/force-merge-like work
  record merge/shrink duration, disk amplification, CPU and p99

TEST placement:
  assert actual shard/node placement matches intended capacity class
  run representative old-data query and recovery drill

TEST policy_change:
  deploy v2 to fixture
  prove when current managed generation sees new definition

TEST failure_recovery:
  create reversible alias/allocation fault
  prove explain surfaces cause
  repair, retry, and confirm healthy state

Passing these tests means the two implementations satisfy the same intent under the tested topology. It does not imply APIs, JSON, permissions, plugins or operational tooling are interchangeable.

4. Expected state evidence

Elastic evidence bundle
GET atlasmart-life-es-*/_ilm/explain?human
GET _cat/aliases/atlasmart-life-es?v
GET _cat/indices/atlasmart-life-es-*?v
GET atlasmart-life-es-*/_settings
GET _cat/segments/atlasmart-life-es-*?v
OpenSearch evidence bundle
GET _plugins/_ism/explain/atlasmart-life-os-*?show_policy=true
GET _plugins/_ism/policies/atlasmart-life-os-v1
GET _cat/aliases/atlasmart-life-os?v
GET _cat/indices/atlasmart-life-os-*?v
GET atlasmart-life-os-*/_settings
GET _cat/segments/atlasmart-life-os-*?v

Add monitoring data for p95/p99 search latency, indexing rate, merge I/O, disk headroom and recovery time. Controller metadata alone cannot certify SLO compliance.

5. Deliberately wrong portability strategy

Wrong: keep one “universal lifecycle.json” and POST it to both products.

At best it fails schema validation. At worst, a hand-translated approximation hides a semantic difference—such as policy update timing, data-tier placement, rollover attachment or managed-service restrictions—and creates silent operational drift. The safer artifact is a common intent document plus two versioned product policies and a shared acceptance-test suite.

6. Production decision record

Decision surface Questions to record
retention correctness What event starts age? rollover or creation? What overrides deletion?
storage cost Which generations move where, and what measurable saving justifies the move?
recovery What is RTO per lifecycle stage? Are larger shrunk shards still recoverable in time?
latency What p95/p99 applies to older data and after cache loss?
capacity Can the target tier/state absorb relocation/merge/recovery bursts?
security Which identity updates/runs the policy and which privileges are captured?
portability Which features have no direct counterpart and what is the fallback?
managed service Which controls are exposed, replaced or automated by the provider?

7. Cleanup

Delete only the disposable Chapter 17 lab
# Elasticsearch: remove managed disposable indices/template/policy in safe order.
DELETE atlasmart-life-es-*
DELETE _index_template/atlasmart-life-es-template-v1
DELETE _ilm/policy/atlasmart-life-es-v1

# OpenSearch: remove disposable indices/template/policy in safe order.
DELETE atlasmart-life-os-*
DELETE _index_template/atlasmart-life-os-template-v1
DELETE _plugins/_ism/policies/atlasmart-life-os-v1

Do not delete shared telemetry data streams, snapshots or policies from other chapters. If lifecycle management blocks cleanup, inspect current state and detach/remove management through supported APIs before deleting artifacts.

8. Bridge to Chapter 18: lifecycle is not disaster recovery

A replica protects availability from a shard/node failure; lifecycle automation controls age/placement/retention; neither is a backup. Chapter 18 moves to snapshot repositories, incremental segment reuse, restore semantics, repository access control and measured RPO/RTO. The lifecycle delete gate therefore becomes a consumer of snapshot/restore evidence rather than pretending deletion itself completes the data-protection story.

Check your understanding

  1. What is the portable lifecycle artifact?
  2. What does passing equivalent tests prove?
  3. Why pair controller state with latency/recovery metrics?
  4. What is the safe alternative when a feature has no counterpart?
  5. Why does Chapter 18 follow lifecycle?
Review the answers

1. A product-neutral intent/acceptance contract plus separate versioned ILM and ISM implementations—not shared JSON.

2. That the tested implementations satisfy the same intended behavior under that topology, not that APIs/features are interchangeable.

3. Policy state proves automation progress, while SLO metrics prove the resulting placement/compaction actually meets operational objectives.

4. Document the gap and choose an explicit fallback or operationally different design.

5. Retention/deletion decisions require independent backup/restore and RPO/RTO evidence; lifecycle alone is not disaster recovery.

Summary

Chapter 17 turned lifecycle from vendor syntax into a measured operational contract. Elastic ILM/data tiers and OpenSearch ISM can express overlapping goals, but they differ in state model, placement semantics, policy updates, simulation, intervention and managed-service boundaries. The durable design is common intent, separate implementations and shared acceptance evidence.

Authoritative references

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only Ethereum or ERC-20 compatible assets to this address.