# nasa/common-metadata-repository architecture

> Architecture diagram of the GitHub repository nasa/common-metadata-repository, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nasa/common-metadata-repository
- Repository: https://github.com/nasa/common-metadata-repository

## Overview

CMR is NASA’s earth-science metadata repository; its Search API exposes repository metadata. The tree shows distinct services for ingest, metadata persistence, indexing, search, access control, bootstrap, virtual products, subscriptions, and operational reindexing. The reindexer excerpts support a detailed request-to-dispatch workflow; the Clojure service excerpts are limited, so their internal call relationships are not asserted. Some repository-wide connections are documented only by the README’s description of a multi-service system.

Main entry points: [`reindexer/app/throttler/worker.py`](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/throttler/worker.py) (Reindex throttler), [`reindexer/app/db/dynamo.py`](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/db/dynamo.py) (Reindex database), [`reindexer/app/routers/reindex.py`](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/routers/reindex.py) (Reindex requests), [`reindexer/app/routers/status.py`](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/routers/status.py) (Job status API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_metadata["Metadata lifecycle"]
  node_ingest_api["Ingest API<br/>[routes.clj]"]
  node_ingest_service["Ingest services<br/>[ingest_service.clj]"]
  node_ingest_validation["Metadata validation<br/>[validation.clj]"]
  node_metadata_api["Metadata API<br/>[routes.clj]"]
  node_concept_service["Concept persistence"]
  node_oracle_concepts[("Oracle concept store<br/>[concepts.clj]")]
end

subgraph group_discovery["Search and access"]
  node_search_api["Search API<br/>[routes.clj]"]
  node_query_service["Query service<br/>[query_service.clj]"]
  node_query_translation["Query translation"]
  node_elastic_search["Elasticsearch search"]
  node_acl_api["Access-control API<br/>[routes.clj]"]
  node_acl_search["ACL search"]
end

subgraph group_operations["Index operations"]
  node_reindex_api["Reindex requests<br/>[reindex.py]"]
  node_reindex_worker["Reindex throttler<br/>[worker.py]"]
  node_reindex_db[("Reindex database<br/>[dynamo.py]")]
  node_work_queue["SQS queues<br/>[client.py]"]
  node_reindex_status["Job status API<br/>[status.py]"]
end

subgraph group_support["Platform services"]
  node_bootstrap_api["Bootstrap API<br/>[routes.clj]"]
  node_bootstrap_service["Bootstrap service"]
  node_virtual_product["Virtual products"]
end

subgraph group_delivery["Notifications and proxy"]
  node_search_proxy["Search proxy<br/>[app.py]"]
  node_subscription_worker["Subscription worker"]
  node_sns["SNS notifications<br/>[sns.py]"]
end

node_client(("API client"))

node_client -.->|"queries"| node_search_api
node_reindex_api -->|"creates jobs"| node_reindex_db
node_reindex_worker -->|"tracks checkpoints"| node_reindex_db
node_reindex_worker -->|"reads and publishes"| node_work_queue
node_reindex_api -.->|"schedules work"| node_reindex_worker
node_reindex_status -->|"reads job state"| node_reindex_db
node_reindex_status -->|"checks queue depth"| node_work_queue
node_subscription_worker -->|"publishes notices"| node_sns
node_search_proxy -.->|"returns response"| node_client

click node_ingest_api "https://github.com/nasa/common-metadata-repository/blob/master/ingest-app/src/cmr/ingest/api/routes.clj"
click node_ingest_service "https://github.com/nasa/common-metadata-repository/blob/master/ingest-app/src/cmr/ingest/services/ingest_service.clj"
click node_ingest_validation "https://github.com/nasa/common-metadata-repository/blob/master/ingest-app/src/cmr/ingest/validation/validation.clj"
click node_metadata_api "https://github.com/nasa/common-metadata-repository/blob/master/metadata-db-app/src/cmr/metadata_db/api/routes.clj"
click node_concept_service "https://github.com/nasa/common-metadata-repository/blob/master/metadata-db-app/src/cmr/metadata_db/services/concept_service.clj"
click node_oracle_concepts "https://github.com/nasa/common-metadata-repository/blob/master/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj"
click node_search_api "https://github.com/nasa/common-metadata-repository/blob/master/search-app/src/cmr/search/api/routes.clj"
click node_query_service "https://github.com/nasa/common-metadata-repository/blob/master/search-app/src/cmr/search/services/query_service.clj"
click node_query_translation "https://github.com/nasa/common-metadata-repository/blob/master/search-app/src/cmr/search/data/query_to_elastic.clj"
click node_elastic_search "https://github.com/nasa/common-metadata-repository/blob/master/elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj"
click node_acl_api "https://github.com/nasa/common-metadata-repository/blob/master/access-control-app/src/cmr/access_control/api/routes.clj"
click node_acl_search "https://github.com/nasa/common-metadata-repository/blob/master/access-control-app/src/cmr/access_control/services/acl_search_service.clj"
click node_bootstrap_api "https://github.com/nasa/common-metadata-repository/blob/master/bootstrap-app/src/cmr/bootstrap/api/routes.clj"
click node_bootstrap_service "https://github.com/nasa/common-metadata-repository/blob/master/bootstrap-app/src/cmr/bootstrap/services/bootstrap_service.clj"
click node_virtual_product "https://github.com/nasa/common-metadata-repository/blob/master/virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj"
click node_reindex_api "https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/routers/reindex.py"
click node_reindex_worker "https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/throttler/worker.py"
click node_reindex_db "https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/db/dynamo.py"
click node_work_queue "https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/sqs/client.py"
click node_reindex_status "https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/routers/status.py"
click node_search_proxy "https://github.com/nasa/common-metadata-repository/blob/master/search-proxy/src/proxy/app.py"
click node_subscription_worker "https://github.com/nasa/common-metadata-repository/blob/master/subscription/src/subscription_worker.py"
click node_sns "https://github.com/nasa/common-metadata-repository/blob/master/subscription/src/sns.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingest_api,node_ingest_service,node_ingest_validation,node_metadata_api,node_concept_service,node_oracle_concepts,node_client toneBlue
class node_search_api,node_query_service,node_query_translation,node_elastic_search,node_acl_api,node_acl_search toneAmber
class node_reindex_api,node_reindex_worker,node_reindex_db,node_work_queue,node_reindex_status toneMint
class node_bootstrap_api,node_bootstrap_service,node_virtual_product toneRose
class node_search_proxy,node_subscription_worker,node_sns toneIndigo
```

## Components

### Metadata lifecycle

- [Ingest API](https://github.com/nasa/common-metadata-repository/blob/master/ingest-app/src/cmr/ingest/api/routes.clj): `ingest-app/src/cmr/ingest/api/routes.clj`
- [Ingest services](https://github.com/nasa/common-metadata-repository/blob/master/ingest-app/src/cmr/ingest/services/ingest_service.clj): `ingest-app/src/cmr/ingest/services/ingest_service.clj`
- [Metadata validation](https://github.com/nasa/common-metadata-repository/blob/master/ingest-app/src/cmr/ingest/validation/validation.clj): `ingest-app/src/cmr/ingest/validation/validation.clj`
- [Metadata API](https://github.com/nasa/common-metadata-repository/blob/master/metadata-db-app/src/cmr/metadata_db/api/routes.clj): `metadata-db-app/src/cmr/metadata_db/api/routes.clj`
- [Concept persistence](https://github.com/nasa/common-metadata-repository/blob/master/metadata-db-app/src/cmr/metadata_db/services/concept_service.clj): `metadata-db-app/src/cmr/metadata_db/services/concept_service.clj`
- [Oracle concept store](https://github.com/nasa/common-metadata-repository/blob/master/metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj): `metadata-db-app/src/cmr/metadata_db/data/oracle/concepts.clj`

### Search and access

- [Search API](https://github.com/nasa/common-metadata-repository/blob/master/search-app/src/cmr/search/api/routes.clj): `search-app/src/cmr/search/api/routes.clj`
- [Query service](https://github.com/nasa/common-metadata-repository/blob/master/search-app/src/cmr/search/services/query_service.clj): `search-app/src/cmr/search/services/query_service.clj`
- [Query translation](https://github.com/nasa/common-metadata-repository/blob/master/search-app/src/cmr/search/data/query_to_elastic.clj): `search-app/src/cmr/search/data/query_to_elastic.clj`
- [Elasticsearch search](https://github.com/nasa/common-metadata-repository/blob/master/elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj): `elastic-utils-lib/src/cmr/elastic_utils/search/query_execution.clj`
- [Access-control API](https://github.com/nasa/common-metadata-repository/blob/master/access-control-app/src/cmr/access_control/api/routes.clj): `access-control-app/src/cmr/access_control/api/routes.clj`
- [ACL search](https://github.com/nasa/common-metadata-repository/blob/master/access-control-app/src/cmr/access_control/services/acl_search_service.clj): `access-control-app/src/cmr/access_control/services/acl_search_service.clj`

### Index operations

- [Reindex requests](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/routers/reindex.py): `reindexer/app/routers/reindex.py`
- [Reindex throttler](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/throttler/worker.py): `reindexer/app/throttler/worker.py`
- [Reindex database](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/db/dynamo.py): `reindexer/app/db/dynamo.py`
- [SQS queues](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/sqs/client.py): `reindexer/app/sqs/client.py`
- [Job status API](https://github.com/nasa/common-metadata-repository/blob/master/reindexer/app/routers/status.py): `reindexer/app/routers/status.py`

### Platform services

- [Bootstrap API](https://github.com/nasa/common-metadata-repository/blob/master/bootstrap-app/src/cmr/bootstrap/api/routes.clj): `bootstrap-app/src/cmr/bootstrap/api/routes.clj`
- [Bootstrap service](https://github.com/nasa/common-metadata-repository/blob/master/bootstrap-app/src/cmr/bootstrap/services/bootstrap_service.clj): `bootstrap-app/src/cmr/bootstrap/services/bootstrap_service.clj`
- [Virtual products](https://github.com/nasa/common-metadata-repository/blob/master/virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj): `virtual-product-app/src/cmr/virtual_product/services/virtual_product_service.clj`

### Notifications and proxy

- [Search proxy](https://github.com/nasa/common-metadata-repository/blob/master/search-proxy/src/proxy/app.py): `search-proxy/src/proxy/app.py`
- [Subscription worker](https://github.com/nasa/common-metadata-repository/blob/master/subscription/src/subscription_worker.py): `subscription/src/subscription_worker.py`
- [SNS notifications](https://github.com/nasa/common-metadata-repository/blob/master/subscription/src/sns.py): `subscription/src/sns.py`

### Other components

- **API client**

## Connections

- API client → Search API: queries
- Reindex requests → Reindex database: creates jobs (evidence: `reindexer/app/routers/reindex.py`)
- Reindex throttler → Reindex database: tracks checkpoints (evidence: `reindexer/app/throttler/worker.py`)
- Reindex throttler → SQS queues: reads and publishes (evidence: `reindexer/app/throttler/worker.py`)
- Reindex requests → Reindex throttler: schedules work (evidence: `reindexer/app/routers/reindex.py`)
- Job status API → Reindex database: reads job state (evidence: `reindexer/app/routers/status.py`)
- Job status API → SQS queues: checks queue depth (evidence: `reindexer/app/routers/status.py`)
- Subscription worker → SNS notifications: publishes notices (evidence: `subscription/src/subscription_worker.py`)
- Search proxy → API client: returns response
