> For the complete documentation index, see [llms.txt](https://boost.filecoin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boost.filecoin.io/v1/experimental-features/local-index-directory/architecture.md).

# Architecture

Local Index Directory architecture and index types

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="https://968384846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F01F3nbbmdopOdEHfj4fF%2Fuploads%2FDRYzHVC2t89Y35VcbiYP%2FScreenshot%202023-05-18%20at%2014.01.13.png?alt=media&amp;token=668ab27e-33df-4dd0-b687-8894ce267da3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://968384846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F01F3nbbmdopOdEHfj4fF%2Fuploads%2FqiR3OYrUgwRJqX8GTFtM%2FScreenshot%202023-05-18%20at%2014.01.23.png?alt=media&amp;token=c0459136-b3d5-48ca-9ba3-bab5f7161737" alt=""><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://boost.filecoin.io/v1/experimental-features/local-index-directory/architecture.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
