# Data-access

Data-Access is the layer that organizes the data in the correct format before having them stored in the storage layer. This layer is similar as the persistence layer in the classical layered architecture pattern.

<https://github.com/RequestNetwork/requestNetwork/tree/master/packages/data-access>

#### Blocks

Heavy communication with the Storage layer can be costly. For example, for a solution using Ethereum, every Ethereum transactions cost some gas.

Data-Access layer will gather transactions and batch them into blocks. This solution allows for less communication with the Storage layer. In this case, it will allow consuming less gas for Ethereum transactions.

#### Local cache for accessing transaction

Data-Access is also responsible for other side tasks:

* Indexing transactions to allow retrieval
* Accessing transactions through a local cache
* Synchronizing with the storage

The storage phase is only complete when indexing has completed. Because this indexing is an Ethereum transaction, you cannot know how long it will take.

It is because when a block is created or read from the storage, the transactions inside it will be indexed and kept in a local cache. When a user wants to get information about a request, Data-Access will directly fetch them from this local cache.

Data-Access stays synchronized with the storage layer. For example, it pulls for new blocks, added by other users, in the storage every 10 seconds.


---

# Agent Instructions: 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://legacy.docs.request.network/advanced/introduction-to-the-request-protocol/data-access.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.
