# Architecture

When designing the Local Index Directory we considered the needs of various Storage Providers (SPs) and the operational overhead LID would have on their systems. We built a solution for:\
\- small- SPs - holding up to 1PiB), and\
\- mid- and large- size SPs - holding anywhere from 1PiB, up to 100PiB data

Depending on underlying block size and data format, index size can vary in size. Typically block sizes are between 16KiB and 1MiB.

At the moment there are two implementations of LID:\
\- a simple LevelDB implementation, for small SPs who want to keep all information in a single process database.\
\- a scalable YugabyteDB implementation, for medium and large size SPs with tens of thousands of deals.

## Index types

In order to support the described retrieval use cases, LID maintains the following indexes:

#### multihash → \[]piece cid

To look up which pieces contain a block

#### piece cid → sector information {sector ID, offset, size}

To look up which sector a piece is in

#### piece cid → map\<mulithash → block offset / size>

To look up where in the piece a block is and the block’s size

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

<figure><img src="/files/3nxExOzXC0I67UhbyAC5" alt=""><figcaption></figcaption></figure>


---

# 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://boost.filecoin.io/v1/experimental-features/local-index-directory/architecture.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.
