# How are S3 Partitions Structured?

When CopyStorm writes data to an S3 partition, each Salesforce record is stored as one or more files in your S3 bucket. The location of every file is derived entirely from the Salesforce record ID. There are no date folders, job ID folders, or table name folders.

## Path Format

```
s3://[bucket]/[folder]/[chars 0–4]/[chars 5–6]/[chars 7–8]/[chars 9–10]/[chars 11–12]/[filename]
```

The folder hierarchy is constructed by slicing the first 13 characters of the Salesforce record ID into five segments:

| Segment | Characters      | Example (ID: 001ZZ010000000000AA) |
| ------- | --------------- | --------------------------------- |
| Level 1 | 0–4 (5 chars)   | 001ZZ                             |
| Level 2 | 5–6 (2 chars)   | 01                                |
| Level 3 | 7–8 (2 chars)   | 00                                |
| Level 4 | 9–10 (2 chars)  | 00                                |
| Level 5 | 11–12 (2 chars) | 00                                |

Full example path for the example ID:

```
s3://my-bucket/my-folder/001ZZ/01/00/00/00/001ZZ010000000000AA.xml
```

## Files Per Record

Each record produces at least one file and potentially more.

**Main record file:** Always present, contains all standard field values as XML:

```
[recordId].xml
```

**Large field files**: Created for any field whose value exceeds 5 KB (e.g. `Body` on ContentVersion). The main XML file references these by name; the data is stored separately:

```
[recordId].[fieldName].txt
```

Example for a file attachment:

```
001ZZ010000000000AA.xml
001ZZ010000000000AA.Body.txt
```

## What Is and Isn't in the S3 Path

|                              | Included in path?                           |
| ---------------------------- | ------------------------------------------- |
| Bucket name                  | Yes (configurable)                          |
| Folder prefix                | Yes (configurable, may be empty)            |
| AWS region                   | Configured separately, not part of the path |
| Salesforce record ID         | Yes. Determines all subfolders and filename |
| Salesforce object/table name | No                                          |
| Org ID                       | No                                          |
| Backup date or job ID        | No                                          |


---

# 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://learn.capstorm.com/reference/copystorm-medic/partition-editor/how-are-s3-partitions-structured.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.
