# The Iceberg Engine

> How rastack-store persists every model as an Apache Iceberg table on object storage.

The storage crate, `rastack-store`, is an Iceberg engine built on two swappable abstractions: an `ObjectBackend` for where bytes live, and a `DataCodec` for how rows are encoded.

## Swappable backends

| Backend | Used for |
| --- | --- |
| `object_store` (LocalFileSystem) | local development on disk |
| `object_store` (S3) | production on AWS |
| `MemoryBackend` | the browser (WASM), dependency-free |

## Parquet everywhere

Arrow and Parquet compile and run on `wasm32`, so `ParquetCodec` is the default in every build — the browser reads and writes the same `.parquet` files as the server. `JsonCodec` remains available for portable dumps.

## How writes work

- **Insert** appends a new data file to the table.
- **Update / delete** rewrite a compacted snapshot.
- `export_warehouse` / `import_warehouse` snapshot a whole warehouse as one blob — this is what powers browser IndexedDB persistence.

> **Note:** The first cut uses an `id` + JSON encoding in Iceberg layout; typed per-field Arrow columns and the full `iceberg` crate catalog are documented as deferred work.

---

_Source: [https://reactapistack.com/docs/iceberg](https://reactapistack.com/docs/iceberg) · Full docs as one file: [llms-full.txt](https://reactapistack.com/llms-full.txt)_
