Storage Options

IMPORTANT: This documentation describes a product in early-access development and does not reflect all functionality intended for general availability (GA). It cannot be used in production until GA.

As part of App Builder, you have access to three storage services for persisting data dynamically from your Runtime actions: Database, Files, and State. Each service is designed for different use cases, with distinct benefits and trade-offs.

Quick comparison

The following table summarizes the key differences between the three storage services:

Feature
State
Files
Database
Best for
Fast key-value access
Large file storage
Complex queries and relationships
Max value size
1 MB
200 GB
Max document size is 16MB
Data model
Key-value pairs
Binary blobs
Document collections
Query capability
Get by key, list with glob
Get by path
Rich queries, aggregations, and indexes
TTL support
Yes (max 365 days)
No
No
Sharing
No
Yes (pre-signed URLs)
No
Provisioning
Automatic
Automatic
Manual (CLI or SDK)

State

State provides a high-performance key-value store optimized for low-latency access to small pieces of data.

Benefits

Drawbacks

When to use state

Learn more about State

Files

Files provides blob storage for large binary data, built as an abstraction layer over cloud storage services.

Benefits

Drawbacks

When to use files

Learn more about Files

Database

Database Storage provides a document-style database with a MongoDB-compatible API, powered by AWS DocumentDB.

Benefits

Drawbacks

When to use database

Learn more about Database

Choosing the right storage

Use this decision guide to select the appropriate storage service:

Is your data larger than 100 KB?
├── Yes → Do you need shareable URLs?
│         ├── Yes → Use Files
│         └── No → Is it structured data needing queries?
│                  ├── Yes → Use Database
│                  └── No → Use Files
└── No → Do you need complex queries or relationships?
         ├── Yes → Use Database
         └── No → Do you need automatic expiration?
                  ├── Yes → Use State
                  └── No → Use State (simpler) or Database (more features)

Common patterns

Use Case
Recommended Storage
User session data
State
Application configuration
State
Uploaded images/documents
Files
Export files for download
Files
User profiles with queries
Database
Product catalogs
Database
Order history with analytics
Database
Temporary processing data
State (with TTL)
Cached API responses
State (with TTL)

Getting started

All three storage services integrate seamlessly with App Builder:

# State - install the library
npm install @adobe/aio-lib-state

# Files - install the library  
npm install @adobe/aio-lib-files

# Database - install the library and provision
npm install @adobe/aio-lib-db
aio app db provision

No additional configuration is needed. The libraries automatically use your App Builder credentials for authentication and authorization.