> For the complete documentation index, see [llms.txt](https://obsrv.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://obsrv.sunbird.org/previous-versions/sb-5.0-version/learn/product-and-developer-guide/data-product/obsrv-2.0-installation-guide/component-diagram.md).

# Component Diagram

<figure><img src="/files/U0kE4DmGj7RcaKyeAyL2" alt=""><figcaption></figcaption></figure>

On Demand Druid Exhaust service will generate CSV reports based on user request. As this is a generic data-product user can request a CSV report for selected columns using filters.

1. **Database Layer**:

* **PostgreSQL Database (job\_request)**: This is where job requests are stored. These requests include information about job configuration. This data appended to postgress by [Filter Format From UI](https://project-sunbird.atlassian.net/wiki/spaces/MC/pages/3339780108/PD+-+Form+Config+-+Release-6.0.0+User+Detail+Report).
* **Druid:** This is where flattened data is stored with the help [ml-analytics](https://ed.sunbird.org/contribute/source-code/workflows/manage-learn/ml-analytics-service/ingestions) ingestion specs and can retrieve data using Druid queries for specific datasorces using [Model Config](https://github.com/Sunbird-Ed/ml-analytics-service/blob/release-5.1.0/druid_data_product_query_config.txt).\
  \
  **Data provider**

| Database   | Table/Datasouces                                                               |
| ---------- | ------------------------------------------------------------------------------ |
| PostgreSQL | job\_request                                                                   |
| Druid      | sl-project, sl-observation, sl-observation-status, sl-survey, ml-survey-status |

2. **Data Processing Layer**:\
   Apache Spark is used to perform transformations, sort columns, eliminate duplicates, and replace unknown values with null. This process enhances data quality, organizes data logically before storing to CSV.

## **User Interaction Diagram**

<figure><img src="/files/RIl8x9lhETsz1ygFmS3v" alt=""><figcaption></figcaption></figure>

This interaction diagram details the complete process of requesting and generating reports. The user can request a specific report through SunbirdEd from the program dashboard. Using exhaust APIs, this will map the request to SunbirdObsrv. OnDemondDruidExhaust data-product will be triggered by a scheduled cron task, which will query postgress and druid to get data and process it using Spark to transform data and generate the report. The user receives the same report once it has been created.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://obsrv.sunbird.org/previous-versions/sb-5.0-version/learn/product-and-developer-guide/data-product/obsrv-2.0-installation-guide/component-diagram.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
