> For the complete documentation index, see [llms.txt](https://doc.cess.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.cess.network/ref/storage/storage-method.md).

# Storage Method

This section describes the data classification, attributes, and storage methods.

## Data Attributes

CESS is an object-based storage service where all data includes two types of attributes: metadata and data content.

* **Metadata**: It is a description of data content, including data length, data unique identifier, data owner, data location index, etc. The structure of the metadata is defined below:<br>

  ```rust
  pub struct FileInfo<T: Config> {
      pub(super) completion: BlockNumberOf<T>,
      pub(super) stat: FileState,
      pub(super) segment_list: BoundedVec<SegmentInfo<T>, T::SegmentCount>,
      pub(super) owner: BoundedVec<UserBrief<T>, T::OwnerLimit>,
  }

  pub struct SegmentInfo<T: Config> {
      pub(super) hash: Hash,
      pub(super) fragment_list: BoundedVec<FragmentInfo<T>, T::FragmentCount>,
  }

  pub struct FragmentInfo<T: Config> {
      pub(super) hash: Hash,
      pub(super) avail: bool,
      pub(super) miner: AccountOf<T>,
  }

  pub struct UserBrief<T: Config> {
      pub user: AccountOf<T>,
      pub file_name: BoundedVec<u8, T::NameStrLimit>,
      pub bucket_name:  BoundedVec<u8, T::NameStrLimit>,
  }

  pub enum FileState {
      Active,
      Calculate,
      Missing,
      Recovery,
  }
  ```
* **Data Content**: the data itself.

## Storage Method

All metadata will be stored in the blockchain network, and there will also be backups in the cache of the storage node. The data content will eventually be stored in the storage node and stored on the disk as a file. The file name is the content's hash value, which is calculated using the [SHA-256](https://wikipedia.org/wiki/SHA-2) hash function.

The following figure shows the file directory structure after running the storage node. The directory is located in the user-specified folder in the configuration file and has three levels of directory structure. The first level is the name of the storage node's signature account, the second is the `bucket`, and the third includes `cache`, `file`, `log`, `space`, and `temp` directories. The `space` directory stores idle data, while the `file` directory stores active data.

![Directory Structure](/files/rmcjXxx6nsu7XquZtEhj)


---

# 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, and the optional `goal` query parameter:

```
GET https://doc.cess.network/ref/storage/storage-method.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
