Forge provides three options for storing app data: Forge-hosted storage, Atlassian app REST APIs (for example, Jira or Confluence), and remote storage that you manage. Use these options to persist and retrieve data securely, at the scale your app needs.
Store your app data with Forge Storage so you can focus on solving customer problems instead of managing infrastructure.
Consider data shape and size limits when selecting the storage option that best fits your use case.
| API | Overview | Ideal for |
|---|---|---|
| Key-Value Store | Simple storage for key/value pairs | User preferences, app configuration, simple data storage |
| Custom entities store | Structured data storage with custom entities and query capabilities | Complex data structures, queryable data, relationships between entities |
| SQL | Fully managed relational database | Complex data models, relationships, transactions, advanced queries |
| Object Store (Preview) | Large file and media storage | Binary data, files, media, large objects |
See platform quotas and limits and storage options for more details.
To develop and test storage-backed behavior on your machine, see Develop with local storage (EAP).
Explore these code examples to see how to perform common storage operations with each Forge storage option.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17import { kvs } from '@forge/kvs'; // Store user preferences export async function saveUserPreferences(userId, preferences) { await kvs.set(`user:${userId}:preferences`, preferences); } // Retrieve user preferences export async function getUserPreferences(userId) { return await kvs.get(`user:${userId}:preferences`); } // Delete user preferences export async function deleteUserPreferences(userId) { await kvs.delete(`user:${userId}:preferences`); }
Explore what's possible by use cases for various Atlassian products using Forge Hosted Storage by:
Local storage mocks are an Early Access Program (EAP) feature. They are experimental and intended for development, testing, and feedback.
EAP features are unsupported, not recommended for production use, and subject to change without notice.
For more details, see Forge release phases: EAP, Preview, and GA.
Use local storage mocks to develop and test storage-backed app behavior without changing hosted storage data. The CLI runs Docker-based services for Key-Value Store (KVS), Secret Store, Custom Entities, and Forge SQL. Your app continues to use @forge/kvs and @forge/sql; tunneling with local storage routes those SDK calls to your machine.
Local storage is not a complete local Forge environment. Other Forge and Atlassian APIs retain their normal context. Test your app against hosted Forge storage before deployment; local mocks do not establish production behavior for security, quotas, performance, durability, or full API compatibility. Object Store is not supported by this local workflow.
manifest.yml and app ID.18090 (KVS) and 18091 (SQL HTTP service) available. These endpoints are fixed, not configurable. The SQL endpoint is not a MySQL client connection.Local storage mocks require Forge CLI 16.0.0 or newer. Install the latest CLI and check the available local storage commands.
1 2 3 4npm install --global @forge/cli@latest forge --version forge storage local --help
From your app directory, install the latest version of each storage SDK your app uses.
| Storage your app uses | Minimum SDK version | Install |
|---|---|---|
| Key-Value Store, Secret Store, or Custom Entity Store | @forge/kvs 2.1.3 | npm install @forge/kvs@latest |
| Forge SQL | @forge/sql 4.0.11 | npm install @forge/sql@latest |
The manifest determines which services are available:
| Manifest declaration | Local storage availability |
|---|---|
permissions.scopes includes storage:app | Enables KVS, secrets, and custom entities through the KVS service. |
app.storage.entities | Supplies custom entity definitions, including attributes and indexes, when preparing KVS storage. Also requires storage:app. |
modules.sql contains a SQL module | Enables the SQL service. Use the normal SQL module declaration with a key and engine: mysql. |
See KVS setup, custom entity definitions, and SQL setup. Importing an SDK alone does not enable a service. An explicitly selected seed or reset service must be declared in the manifest; with no storage services declared, start has nothing to start.
From the app directory, start storage and check its status:
1 2 3forge storage local start forge storage local status
Start reads the manifest, starts or reuses the required services, waits for readiness, and prepares the app's local namespace. It returns when preparation finishes; it does not stay attached, reset data, or load seed files. Status reports health for services declared by the current app, not a global inventory of all local containers.
To route your app's storage SDK calls locally, run:
1 2forge tunnel --local-storage
This command also starts and prepares the manifest-declared services, so a separate start is optional. It supplies the SDK routing environment and the tunnel bridge before loading your app handler. Starting containers alone does not redirect SDK calls. Keep using the normal SDK APIs in your app; manually setting local routing variables does not establish a supported standalone execution context.
The storage runtime is shared across apps and tunnels using the same Docker context. Exiting a tunnel started with --local-storage stops that shared runtime, even if storage was already running before the tunnel started. If the tunnel fails after the CLI has prepared the app namespace, it also stops the shared runtime. A failure while preparing the app namespace leaves the containers running. Coordinate lifecycle changes with other local consumers.
To return to hosted storage routing, end the local-storage tunnel and start a fresh forge tunnel process without local routing environment variables. Restart the tunnel after changing storage configuration; KVS selects its client when the SDK is imported.
Use synthetic fixtures to reproduce storage scenarios while developing through the tunnel. Seed commands start and prepare the selected services if necessary, but do not reset existing data. Startup and tunneling never load fixtures automatically.
For KVS, create kvs-seed.json in the app directory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16{ "kvs": [ { "key": "user:1", "value": { "name": "Ada", "active": true } } ], "customEntities": [ { "entityName": "employee", "key": "employee:1", "value": { "name": "Ada", "department": "Engineering" } } ], "secrets": [ { "key": "example-api-key", "value": "local-development-value" } ] }
This example requires storage:app and an employee entity with string attributes name and department in your manifest. Omit customEntities if your app does not declare that entity. Treat local secrets as plaintext development data: never use real credentials or commit them in fixtures.
Load the file:
1 2forge storage local seed --kvs ./kvs-seed.json
For an app that declares SQL, create sql-seed.sql:
1 2 3 4CREATE TABLE people (id INT PRIMARY KEY, name VARCHAR(64)); INSERT INTO people (id, name) VALUES (1, 'Ada'); UPDATE people SET name = 'Ada Lovelace' WHERE id = 1;
Load the SQL file instead, or load both files in one command:
1 2 3 4forge storage local seed --sql ./sql-seed.sql # Alternative: seed both services forge storage local seed --kvs ./kvs-seed.json --sql ./sql-seed.sql
These are alternatives, not a sequence to run against the same data. The SQL example is not safe to replay unchanged if the table already exists. Use a deliberate reset before repeating it. SQL fixtures use ordinary MySQL/TiDB statements, not client-side DELIMITER directives.
Paths are relative to the command's working directory; absolute paths are also accepted. Running forge storage local seed without selectors displays seed format help. The CLI reads all selected files before starting services, but forwards their contents to the services for processing rather than fully validating JSON or SQL itself.
KVS and SQL seed operations are independent. One can succeed while the other fails, and an overall command failure does not mean no data changed. SQL schema changes can remain after a later statement fails. Inspect each service's result before retrying; there is no cross-service rollback.
Reset is destructive and runs without a confirmation prompt. Choose the scope carefully:
| Command | Data reset for the current app |
|---|---|
forge storage local reset | All storage services declared in the manifest. |
forge storage local reset --kvs | KVS, custom entity records, and secrets; leaves SQL data alone. |
forge storage local reset --sql | Recreates an empty SQL namespace; leaves KVS-backed data alone. |
You can combine --kvs and --sql when your manifest declares both services. If either declaration is missing, the command fails before resetting any data. Reset starts and prepares selected services if needed and leaves them running afterward. As with seed, results are independent: inspect each service's result if reset fails. Run seed explicitly to reload fixtures after a reset.
To stop the shared services without resetting data:
1 2forge storage local stop
Stop retains the named Docker data volume, so data can be reused on a later start. It interrupts other apps and tunnels using the shared runtime.
Local namespaces derive from the manifest app ID, not the directory, Git branch, hosted environment, or process. Copies of an app with the same ID share local data. Coordinate resets and fixtures, and use distinct keys or tables when multiple consumers share an app ID. Do not change an existing app ID just to isolate a test run.
Use the tunnel to exercise storage-backed app behavior with these fixtures. Starting storage does not make the SDKs independently runnable in an arbitrary Node process. Inspect local data through your app's normal KVS and SQL APIs; this workflow does not provide a storage viewer or SQL REPL.
| Symptom | What to check |
|---|---|
Local commands or --local-storage are unavailable | Check forge --version and forge tunnel --help, then verify the CLI and SDK versions in your app. |
| Docker, Compose, or image download fails | Check Docker daemon access, Compose availability, and access to the registry named in the error. |
| A port is already in use | Free ports 18090 and 18091 or coordinate the process using them. There is no custom-port option. |
| A service is unavailable or status says stopped | Check the current app's manifest declarations. Status masks undeclared services as stopped even if shared containers exist. |
| The SDK reports a missing endpoint, namespace, or bridge | Run through forge tunnel --local-storage with its generated routing context, rather than manually setting environment variables. Restart the tunnel after configuration changes. |
| A seed file cannot be read | Check its path and permissions relative to the directory where you ran the command. |
| Seed or reset reports a failure | Inspect per-service results and existing data before retrying. Some operations may have succeeded. |
| Another process loses storage access | Check whether another process stopped storage or a local-storage tunnel exited. Coordinate before restarting. |
| Old data appears after restarting or switching branches | Stop preserves data, and the same app ID shares a namespace. Use an intentional reset, not a directory or branch change, to clear it. |
KVS expiry. Local KVS keeps values after their time-to-live (TTL) expires. This lets you test the race condition where your app reads an expired value before hosted KVS deletes it.
SQL migration retries. The emulator prepares the local database at startup and does not simulate hosted rate limits. Test your migration's retry logic separately for cases where the database is still being provisioned or Forge SQL throttles a request.
Simulation limits. The KVS and SQL emulators currently do not support rate limit simulation, fault or error injection, or latency simulation. Future releases may add these capabilities.
Forge can also use Atlassian app-specific APIs to store and retrieve data for Atlassian Cloud sites and workspaces. This data is accessible to all apps installed within the site (as well as users). See Atlassian app REST APIs for more details.
Each storage option has different cost characteristics. For pricing and free monthly allowances, see Forge platform pricing.
For recommendations on reducing storage costs (such as caching, batching, and querying instead of iterating), see Storage optimisations.
Using the capabilities discussed in this section may make your app ineligible for Runs on Atlassian.
To check if your app is eligible for Runs on Atlassian, use the
Forge CLI eligibility tool.
Forge also lets you integrate your app with services hosted on other platforms. This allows Forge apps to store data remotely on self-hosted databases or third-party storage services. For more information about integrating with remote services, see Forge Remote and Accessing Forge storage from a remote via REST API.
Forge data is scoped per app installation to provide basic tenant safety. However, you still need to avoid storing tenant data in module-level variables or in-memory caches to prevent cross-tenant data leaks.
See Tenant data isolation in Forge apps for unsafe patterns to avoid and safe alternatives.
Rate this page: