# mulesoft Object Store - Full Documentation --- product: Object Store --- # Configuring Connected Apps > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The Connected Apps feature enables you to integrate external applications with Anypoint Platform by providing access to those applications without sharing your user credentials. For information about Connected Apps, see [Connected Apps in Anypoint Platform](https://docs.mulesoft.com/access-management/connected-apps-overview) and [Anypoint Platform Connected Apps for Developers](https://docs.mulesoft.com/access-management/connected-apps-developers). ## Configure a Connected App in Access Management To create a Connected App with object store scopes: 1. In Anypoint Platform, go to **Access Management**. 2. In the Access Management navigation menu, click **Connected Apps**. 3. Click **Create App**. 1. Specify a name for the app. 2. Select **App acts on its own behalf (client credentials)**. 3. Click **Add Scopes**. 4. Select the object store scopes to apply: ![Scopes for Object Store connected apps](/mulesoft/current/en-us/object-store/_images/os-conn-apps-scopes.png) 5. Click **Next** and select the business groups and environments to apply the scopes to. 6. Click **Review**. 7. Click **Add scopes** or **Cancel** to cancel your changes. 4. Click **Save** or **Cancel** to cancel your changes. 5. From the **Connected Apps** page, click **Copy Id** and **Copy Secret** for the app you just created. Use this client ID and client secret to get the access token required to authenticate with the Object Store v2 API. ## Configure a Connected App Using the API For information about configuring a connected app using the API, see [How to create connected apps using the API](https://help.salesforce.com/s/articleView?id=001115949&type=1). ## Object Store Scopes Object store scopes apply to all stores in the given organization and environment. Unless otherwise noted, these scopes apply to both object stores and Object Store v2 object stores.
Scope in UIScope in APIDescription

Manage stores

manage:store

Create, read, update, and delete stores.

Manage stores data

manage:store_data

Perform all store operations including data, partition, and confirmation APIs.

View stores

read:store

Read store details.

Manage store clients (object store only)

Not Available

Manage all clients of a cloud store.

This scope doesn’t apply to Object Store v2.

View store clients (object store only)

Not Available

View all clients of a cloud store.

This scope doesn’t apply to Object Store v2.

--- product: Object Store --- # FAQ: Object Store v2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## Where is Object Store v2 available?
Control PlaneLocationRegionRegion Name

US Cloud

North America

US East (N. Virginia)

us-east-1

US East (Ohio)

us-east-2

US West (N. California)

us-west-1

US West (Oregon)

us-west-2

Canada (Montreal)

ca-central-1

South America

Brazil (São Paulo)

sa-east-1

Asia Pacific

Singapore (Singapore)

ap-southeast-1

Australia (Sydney)

ap-southeast-2

Japan (Tokyo)

ap-northeast-1

Europe

Ireland (Dublin)

eu-west-1

Germany (Frankfurt)

eu-central-1

UK (London)

eu-west-2

EU Cloud

Europe

Ireland (Dublin)

eu-west-1

Germany (Frankfurt)

eu-central-1

Canada Cloud

North America

Canada (Montreal)

ca-central-1 *

Japan Cloud

Asia Pacific

Japan (Tokyo)

ap-northeast-1 *

India Cloud

Asia Pacific

India (Mumbai)

ap-south-1 *

Australia Cloud

Asia Pacific

Australia (Sydney)

ap-southeast-2 *

United Kingdom Cloud

Europe

United Kingdom (London)

eu-west-2 *

MuleSoft Government Cloud

US Government

US GovCloud (West)

us-gov-west-1

**\*** You can’t access or configure some Object Store v2 features. For information, see [Object Store v2 on Hyperforce](https://docs.mulesoft.com/object-store/#osv2-on-hyperforce). ## What Mule versions support Object Store v2? - All Mule runtime engine 4.x versions Mule 4 supports Object Store v2, but does not support Object Store v1. ## Can I use Object Store v2 for apps deployed to on-premises servers? On-premises Mule applications can access Object Store v2 only via the Object Store REST API. For on-premises deployments, you can use the object store included in Mule. For information about the Mule object store, see [Store Application Data Using Object Stores](https://docs.mulesoft.com/mule-runtime/latest/mule-object-stores). ## How can I see usage data? To view Object Store v2 usage data: - For a UI view, use [Anypoint Usage Reports](https://docs.mulesoft.com/object-store/osv2-usage#access-os-usage-reports). - For programmatic access, use the [Anypoint Usage API](https://docs.mulesoft.com/object-store/osv2-usage#anypoint-usage-api). ## What happens when the transaction limit for my subscription is reached? An Object Store v2 subscription pack allows up to 100 million transactions per month for an Anypoint Platform organization. This limit is applied across all Production and non-Production environments. If your usage exceeds your license limit, Object Store v2 continues to work. MuleSoft notifies your account administrator and team of any billing-related information. ## Is Object Store v2 persistent in the same region as the worker? Yes, Object Store v2 is in the same region as the worker where the app is initially deployed. For example, if you deploy to the Singapore region, the object store persists in the Singapore region. > [!IMPORTANT] If after the first deploy, you move the app to a different region, Object Store v2 > remains in the original region to avoid data loss. Your use of Object Store v2 never moves from > one region to another. When you need to deploy both an app and object store to a different region, > delete the app and re-upload the app into the new region. This action loses all the data that may > exist in the storage. ## Can an app deployed to CloudHub access the object store of another CloudHub app? You can configure a Mule app to use the Object Store REST API to store and retrieve values from an object store in another Mule app. However, Object Store v2 isn’t designed for app-to-app communication. To share data between two Mule 4 apps, use a queue in [Anypoint MQ](https://docs.mulesoft.com/mq/). For information about object store limitations, see [Object Store Limitations](https://docs.mulesoft.com/object-store-connector/latest/#object-store-limitations). For information about the Object Store REST API, see [Object Store v2 API](https://dev-portal.mulesoft.com/apis/object-store-v2.html). ## What are the limits on an object store? The total size of an object store isn’t limited, but each value is limited to 10 MB. Every API call (via the connector or API) to Object Store v2 counts toward the API rate limiting (transactions per second (TPS)): - Base subscription: 10 TPS per app - Premium add-on subscription: 100 TPS per app ## What is the maximum number of keys that can persist in Object Store v2? In Object Store v2, there is no limit on the number of keys per app. ## What is the maximum key size? The maximum size for a key is 1024 bytes (UTF-8 encoding). Object Store v2 for CloudHub doesn’t support using pipe (`|`) characters in keys and converts any spaces to plus (`+`) characters. ## What are the advantages of using partitions? You can use partitions to divide the object store into separate areas for your stored and retrieved keys. Partitions are logical, rather than physical, structures. For this reason, data access time is the same, whether you store keys in one partition or multiple partitions. ## How long can data persist in Object Store v2? The maximum TTL (time to live) is 2592000 seconds (30 days). For information about rolling and static TTL, see [Time to Live (TTL)](https://docs.mulesoft.com/object-store/#time-to-live). To configure TTL, see [Configure a Custom Time to Live Period](https://docs.mulesoft.com/object-store/osv2-guide#configure-a-custom-time-to-live-period). ## Where is the Object Store v2 REST API portal? The Object Store v2 API is available in the Anypoint Platform Developer’s portal: - [Object Store v2](https://dev-portal.mulesoft.com/apis/object-store-v2.html) ## Where is the Object Store connector? [Anypoint Exchange](https://anypoint.mulesoft.com/exchange/?search=objectstore) provides assets for the Mule 4 Object Store connector used by Studio 7. ## Do I need a different Object Store connector for Object Store v2 and Object Store v1? All versions of Mule’s Object Store Connector work with both Object Store v1 and Object Store v2. ## Why are Object Store values in binary format? When you view an Object Store key in Runtime Manager, the value for the key displays as `[binary value] BINARY`. Mule 4 wraps values into a Mule object that causes them to be only visible in binary through Anypoint Platform. Behind the scenes, Mule 4 executes binary serialization with the Mule internal serializer. The user interface can’t deserialize the object, hence it can only tell you that the value is now binary in the user interface. To view the key value, you need an Object Store retrieve flow in your app’s connector, such as: ```xml ``` For more information, see [Tutorial: Create a Studio 7 Project](https://docs.mulesoft.com/object-store/osv2-tutorial#create-a-studio-7-project). ## Are there rate limits on Object Store v2? Customers who have not purchased a separate Object Store SKU are rate limited to 10 transactions per second per app. If an app for an account that has not purchased the Object Store v2 SKU exceeds the rate limit, further requests aren’t processed for a time and a 429 HTTP error status code results. To go beyond the base 10 TPS rate limit, contact your MuleSoft account team. ## How is Object Store v2 data secured? Object Store v2 uses Transport Layer Security (TLS) 1.2 and 1.3 for secure transport and doesn’t support the deprecated TLS versions 1.0 and 1.1. Data at rest is stored using FIPS 140-3 compliant encryption standards. If you require a higher level of security, we recommend that you encrypt sensitive data before writing it to the Object Store. ## Does Object Store cache data or perform I/O for each read and write? Object Store v2 performs I/O for each read and write. With Object Store v2, the API call is localized to the same data center as the Runtime Manager app. ## What happens when you reenable the **Use Object Store v2** option after disabling it? By default, the **Use Object Store v2** option is enabled during CloudHub application deployment. If you disable and then reenable this option in Runtime Manager, the original key-value pairs persist as long as the key-value pair TTL isn’t expired. ## See Also - [Object Store v2 API](https://dev-portal.mulesoft.com/apis/object-store-v2.html) - [Configure a Custom Time-to-Live Period](https://docs.mulesoft.com/object-store/osv2-guide#configure-a-custom-time-to-live-period) - [Create Object Store Partitions](https://docs.mulesoft.com/object-store/osv2-guide#create-object-store-partitions) - [Object Store Connector for Mule 4](https://docs.mulesoft.com/object-store-connector/latest/) - [The Different Types of Object Stores Explained](https://help.salesforce.com/s/articleView?id=001123185&type=1) --- product: Object Store --- # Object Store v2 Overview > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Object Store v2 lets CloudHub applications store data and states across batch processes, Mule components and applications, from within an application or by using the Object Store REST API. You can select Object Store v2 as the implementation for Mule 4 in CloudHub by checking the **Object Store V2** checkbox in Runtime Manager at deployment time. See the [FAQ](https://docs.mulesoft.com/object-store/osv2-faq) for Object Store information. ![A diagram illustrating how Mule and user-defined components connect to a central data store](/mulesoft/current/en-us/object-store/_images/osv2-architecture.png) On-premises Mule applications can access Object Store v2 only via the Object Store REST API. You can configure a Mule app to use the Object Store REST API to store and retrieve values from an object store in another Mule app. ## Object Store v2 Features - Supports both static and rolling [TTL](#time-to-live) (time to live) for data persistence. - Supports using the Connected Apps feature to authenticate with Anypoint Platform using APIs. See [Configuring Connected Apps](https://docs.mulesoft.com/object-store/osv2-connected-apps). - Allows for an unlimited number of entries. There is no limit on the total size of v2 object-stores. - Stores values up to 10 MB (when Base64 encoded) in size. You can estimate base64 size of a payload as follows: CEILING(base10size \* 1024/3) \* 4, where base10size is object size in bytes. + Example: A base10 payload size of 7.5 MB converts to 10.24 MB base64. - Is available in all supported regions and availability zones within each region. - Is co-located in the same region as your workers. For example, workers hosted in Singapore would use Object Store v2 hosted in Singapore. - Provides a Mule connector and REST interface for access by external applications. - Provides end-to-end secure TLS-transport. - Encrypts persistent storage to FIPS 140-2 compliant standards. You can use the existing Object Store connector to write to the object store, regardless of whether you are using v1 or v2. The Object Store v2 user interface is available in the Anypoint Platform > Runtime Manager. ## Object Store v2 Permissions
Required PermissionsGrants the Ability toNotes

Manage stores

Create, read, update, and delete stores.

Manage stores data

Perform all store operations including data, partition, and confirmation APIs.

View stores

Read store details.

Manage store clients

Manage all clients of a cloud store.

This permission doesn’t apply to Object Store v2.

View store clients (object store only)

View all clients of a cloud store.

This permission doesn’t apply to Object Store v2.

To assign user permissions, follow the steps in [Grant Permissions to Users](https://docs.mulesoft.com/access-management/users#grant-user-permissions). To use teams to assign permissions, follow the steps in [Using Teams to Manage User Permissions](https://docs.mulesoft.com/access-management/teams). ## Time to Live (TTL) The TTL can be either [_rolling_](#rolling-ttl) or [_static_](#static-ttl). The `entryTtl` value, specified in the global configuration parameters for the connector, determines when to evict key-value pairs from the store. If the app doesn’t specify a value for `entryTtl`, the default value depends on the Mule version for the app: - Mule versions 4.2.1 and later: Object stores have a rolling TTL by default. Accessing the data during the last seven days of a 30-day window extends the TTL for another 30 days. - Mule versions earlier than 4.2.1: Object stores have a static TTL of 30 days by default. Updating the data (for example, by overwriting the key) resets the TTL. To configure TTL, see [Configure a Custom Time to Live Period](https://docs.mulesoft.com/object-store/osv2-guide#configure-a-custom-time-to-live-period). ### Rolling TTL When you configure rolling TTL, accessing the data during the last seven days of a 30-day window extends the TTL for another 30 days. Rolling TTL applies to individual key-value pairs. Each key in a partition tracks its own TTL window. Accessing one key doesn’t extend the TTL for other keys in the same partition, and keys expire independently based on their last access time. If you don’t access the data during that time, the object store evicts the data in the next seven to 30 days from the most recent expiration date. The Object Store Connector operations that extend TTL are:
Extends TTLDoesn’t Extend TTL

Retrieve

Contains

Retrieve All

Clear

Retrieve All Keys

Remove

Store

- The minimum rolling TTL is 30 days (2592000 seconds). - The maximum rolling TTL is unlimited if you continue to access the data in the last seven days of the 30-day window. ### Static TTL When you configure static TTL, the value of `entryTtl` determines when to evict the data: - The minimum static TTL is one second. - The maximum (and default) static TTL is 2592000 seconds (30 days). If the `entryTtl` value is less than one second or greater than 30 days, TTL is set to the maximum value of 2592000 seconds (30 days) without returning an error. Updating the data (for example, by overwriting the key) resets the TTL. ## Upgrade to Object Store v2 - Back up all the data in your current object store. > [!IMPORTANT] Data doesn’t carry over from Object Store v1 to v2. Any data in a v1 object store, > including watermarks and other Mule component states, doesn’t move to v2. If you revert to > Object Store v1, your Object Store v1 data is still there. - To access Object Store v2, in Anypoint Platform, click **Runtime Manager**. Click the name of your application to view the application’s dashboard, and click **Manage Application**. In the **Settings** screen, click **Use Object Store v2**. Accept the prompt. The **Application Data** section of the Runtime Manager’s dashboard changes to **Object Store**. ## Object Store Notes - For Object Store v2 region availability see [Where is Object Store v2 available?](https://docs.mulesoft.com/object-store/osv2-faq#where-is-object-store-v2-available) - The Object Store Connector works for both Object Store version 1 and 2. - Object Store v2 enforces a maximum data persistence of 30 days from time of creation. - Premium add-on customers are allowed up to 100 TPS per app. The free Object Store v2 limits usage to 10 transactions per second (TPS) per application. To upgrade to premium and increase your TPS limit, contact the MuleSoft account team. - For CloudHub applications using Mule 4, if you choose Object Store v2, Object Store v2 overrides the `_defaultPersistentObjectStore` object store. - Using Object Store v2 with multi-worker CloudHub applications might result in data discrepancies or key clashes. This behavior occurs because the "Distributed Locking" feature isn’t available in CloudHub and CloudHub 2.0 when working with Object Store v2. As a result, under certain conditions, when multiple Mule components attempt to update Object Store v2 tables simultaneously, such calls may fail. To avoid these issues, use a distributed key-value store as a lock to synchronize access to Object Store v2. For information about distributed locking in Mule runtime engine, see [Distributed Locking](https://docs.mulesoft.com/mule-runtime/latest/distributed-locking). ## Object Store Features by Control Plane
Object Store FeatureUS Cloud and EU CloudCanada Cloud, Japan Cloud, India Cloud, Australia Cloud, United Kingdom Cloud

Yes

Yes

Yes

No

No

Yes

### Limitations by Control Plane All Object Store v2 features are supported on [Canada Cloud](https://ca1.platform.mulesoft.com), [Japan Cloud](https://jp1.platform.mulesoft.com), [India Cloud](https://in1.platform.mulesoft.com), [Australia Cloud](https://au1.platform.mulesoft.com), and [United Kingdom Cloud](https://gb1.platform.mulesoft.com) with the following exceptions:
LimitationCanada Cloud, Japan Cloud, India Cloud, Australia Cloud, United Kingdom Cloud

Not supported. Deploy apps to CloudHub 2.0 shared spaces or Anypoint Runtime Fabric.

For information about the regions where Object Store v2 is available, see [Object Store v2 Regions](https://docs.mulesoft.com/object-store/osv2-faq#osv2-regions). For information about Anypoint Platform on other control planes, see [Salesforce Hyperforce Overview](https://docs.mulesoft.com/hyperforce/). ## See Also - [Salesforce Hyperforce Overview](https://docs.mulesoft.com/hyperforce/) - [Permissions by Product in Anypoint Platform](https://docs.mulesoft.com/access-management/permissions-by-product) - [Object Store v2 Release Notes](https://docs.mulesoft.com/release-notes/object-store/anypoint-osv2-release-notes) - [Object Store Connector for Mule 4](https://docs.mulesoft.com/object-store-connector/latest/) - [Object Store Watermarks](https://blogs.mulesoft.com/dev-guides/how-to-tutorials/data-synchronizing-made-easy-with-mule-watermarks/) --- product: Object Store --- # Object Store v2 Rate Limiting and Billing > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Monitor your Object Store v2 billing by understanding how API requests and effective API requests impact rate limiting and billing. Track usage metrics through Anypoint Usage Reports or the Anypoint Usage API to optimize application performance and avoid exceeding your subscription limits. Object Store v2 uses two metrics to determine rate-limiting and billing: API requests and effective API requests. To access usage data, use [Anypoint Usage Reports](#access-os-usage-reports) or the [Anypoint Usage API](#anypoint-usage-api). > [!NOTE] If you enable **Use Object Store v2**, any connector, module, or policy that relies on > Object Store uses Object Store v2, even if your application doesn’t explicitly interact with > Object Store. This usage counts toward rate limiting and billing. > > These are some examples of connectors, modules, and policies use Object Store internally: > > - API Gateway policies, such as Rate Limiting, SLA-based Rate Limiting, Spike Control, and HTTP > Caching > > - B2B Solution Runtime Engine components, such as endpoint services, document processing, and API > replication > > - Salesforce connectors > > - Google connectors (primarily for OAuth flows) > > - Microsoft connectors > > - SAP S/4HANA Cloud > > - SAP SuccessFactors > > - AS2 > > - RosettaNet > > - Redis > > - Power BI > > - MCP > > - A2A > > - OAuth provider templates and OAuth introspection services API Requests API requests are HTTP transactions, such as GET, PUT, and POST. Every API request to Object Store v2 counts toward the transactions per second (TPS) limit, including requests that return `OS:KEY_NOT_FOUND`. See [Rate Limiting](#rate-limiting). Effective API Requests Effective API requests are the units that Object Store uses to calculate billing. One successful API request could generate many effective API requests. See [How Billing is Calculated](#how-billing-is-calculated). > [!NOTE] The Object Store UI shows effective API request data for two months: the current and > previous month. ## Rate Limiting Every API request (via the connector or API) to Object Store v2 counts toward the TPS limit, including requests that return `OS:KEY_NOT_FOUND`. \+ TPS and billing are calculated separately. Only successful (2xx) effective API requests count toward monthly billing. The TPS limit is based on your subscription type:
Subscription TypeTPS Limit

Base subscription

10 TPS per store

Premium add-on subscription

100 TPS per store

Rate limiting is applied per application. Each application has a single Object Store allocation, so multiple uses of Object Store within the same application share the same TPS limit. For example, if your app includes both `case-obj-store` and `ticket-obj-store`, Object Store v2 calculates the 100 TPS limit across all stores used within the application combined. If an app retrieves 1500 keys from an object store with a page size of 25: - With the base subscription, the response is throttled over 6 seconds. - With the premium subscription, the response isn’t throttled. If the store exceeds the number of TPS allotted based on the subscription type, Object Store v2 returns a `429 HTTP Error` response, indicating that it reached the rate limit. If the store reaches the TPS limit, you can either upgrade to a premium subscription or redesign the app to send API requests more slowly. > [!NOTE] Requests that return a 429 response (due to rate limiting) don’t count toward your monthly > billing usage and quota. ## How Billing is Calculated All effective API requests that return a 2xx (success) response count toward your monthly billing usage and quota. An effective API request counts as **one or more units** against the quota, depending on the size of the payload and the number of keys returned. - Each API request up to 100 KB of object-payload data (if applicable) counts as one unit against the quota. For example, if an app retrieves one key from an object store with a total payload size of 500KB, the request counts as five units against the quota. - Each 100 KB of payload data above 100 KB counts as an additional unit. For example, if an app inserts, updates, or retrieves an item with a total payload size of 101KB from an object store, the operation counts as two units against the quota. - For the Retrieve All and Retrieve All Keys operations, the size of all key-value pairs in the object store partition counts toward billable units. For example, if an app runs the Retrieve All Keys operation to retrieve only the keys in the object store, the billable unit is based on the size of the key-value pairs, not just the keys. - For each Store operation, the size of the item being inserted or updated counts toward billable units. For example, if an app inserts or updates one key in an object store with a total payload size of 300KB, the request counts as three units against the quota. - Each DELETE API call counts as a single billable unit. Additional units apply to deleted partitions.

API Call

Description

Billable Units

Delete store

Deletes the store, all partitions in the store, and all key-value pairs in each partition

  • One billable unit for the DELETE API call

  • One billable unit for each deleted partition in the store

Delete partitions in store

Deletes all partitions in the store, including the key-value pairs in each partition

  • One billable unit for the DELETE API call

  • One billable unit for each deleted partition in the store

Delete partition

Deletes all key-value pairs and then deletes the partition

One billable unit

Delete all keys and values in the partition

Deletes every key and its associated value from the specified partition

One billable unit

Delete key

Deletes a single key and its associated value

One billable unit

For example, a call to delete a store with two partitions counts as three billable units against the quota: - DELETE API call: one billable unit - Two partitions: two billable units ## Maximum Number of API Requests Per Month This table lists the maximum number of API requests per month, based on your subscription type:

Subscription Type

Maximum API Requests Per Month

Base subscription

26 million

Premium add-on subscription

100 million per add-on subscription

If your usage exceeds your license limit, Object Store v2 continues to work. MuleSoft notifies your account administrator and team of any billing-related information. ## Access Effective API Request Usage Reports To view Object Store usage reports in Usage: 1. In Anypoint Platform, go to **Usage**. 2. Select **Object Store** in the **Product** section: ![Object Store on the Usage Reports page](/mulesoft/current/en-us/object-store/_images/os-usage-report.png) 3. Select a month from the **Monthly Usage Report** tab or day from the **Daily Usage Report** tab. The report shows: - Total effective API requests for the selected period - Effective API requests by store 4. Click **Export as CSV** to download the usage date for the selected period. For more information, see [Usage Reports](https://docs.mulesoft.com/general/usage-reports). ## Retrieve Usage Metrics with the Anypoint Usage API To retrieve Object Store v2 usage metrics programmatically, use the Anypoint Usage API. The Anypoint Usage API uses AMQL (Anypoint Metric Query Language), a SQL-like query language, to query usage meters. ### Before You Begin - Get a bearer token for an Anypoint Platform user with the **Usage Viewer** permission at the root organization level. See [Get a Bearer Token](https://docs.mulesoft.com/object-store/osv2-apis#get-bearer-token). ### Discover Available Meters To view all available Object Store meters and their column names: ```bash curl -X GET 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:describe' \ -H 'Authorization: Bearer ' ``` ### Query Object Store Usage To retrieve effective API request counts, submit a POST request using AMQL: ```bash curl -X POST 'https://anypoint.mulesoft.com/metering/usage/api/v1/meters:search' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "query": "SELECT effective_api_requests FROM object_store_effective_api_requests_count WHERE timestamp between and TIMESERIES P1D" }' ``` Replace `START_EPOCH_MS` and `END_EPOCH_MS` with epoch milliseconds for your date range. > [!NOTE] The Usage API uses epoch milliseconds, not ISO 8601 strings. For example, > `2024-01-01T00:00:00.000Z` = `1704067200000`. ### AMQL Query Reference ```sql SELECT FROM WHERE timestamp between and [AND org_id = ''] [AND env_id = ''] TIMESERIES ```
ParameterDescriptionValues

TIMESERIES

Granularity of results

P1D (daily) or P1M (monthly)

Daily range (P1D)

Maximum query interval

30 days

Monthly range (P1M)

Maximum query interval

60 days

Data recency

Delay for data consolidation

3-day delay

> [!IMPORTANT] `SELECT *` is not supported. Always specify column names explicitly. Use the > `:describe` endpoint to get the current column names for each meter. ## See Also - [Object Store FAQ](https://docs.mulesoft.com/object-store/osv2-faq) - [Usage Reports](https://docs.mulesoft.com/general/usage-reports) --- product: Object Store keywords: object, store, object store, release notes --- # Object Store v2 Release Notes > For the full documentation index, see: https://docs.mulesoft.com/llms.txt These release notes are provided for Object Store: - [Object Store v2 Release Notes](https://docs.mulesoft.com/release-notes/object-store/anypoint-osv2-release-notes) - [Object Store Connector Release Notes (for Mule 4)](https://docs.mulesoft.com/release-notes/connector/object-store-connector-release-notes-mule-4) ## See Also - [CloudHub Runtime and Operating System Patch Update Release Notes](https://docs.mulesoft.com/release-notes/cloudhub/cloudhub-runtimes-release-notes) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Object Store --- # Object Store v2 REST APIs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt > [!NOTE] Where possible, we changed noninclusive terms to align with our company value of Equality. > We maintained certain terms to avoid any effect on customer implementations. The Object Store v2 APIs enable you to use REST to: - Retrieve a list of object stores and keys associated with an application. - Store and retrieve key-value pairs in an object store. - Delete key-value pairs from an object store. Object Store provides these APIs: - [Object Store v2 API](#osv2-api) ## Before You Begin - Create an app that uses Object Store v2 and [deploy it to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub). - [Store a key-value pair in the object store](https://docs.mulesoft.com/object-store/osv2-guide#send-data-to-an-object-store). - [Get the bearer token](#get-bearer-token) for an Anypoint Platform user using the Access Management API: You need the bearer token to access all Object Store v2 APIs. - [Get the ORG\_ID and ENV\_ID](#get-org-env-id). You need the organization ID and environment ID for operations with all Object Store v2 APIs. - [Get the REGION\_ID](#get-region-id). You need the region ID for operations with the Object Store v2 API. - [Get the STORE\_ID](#get-store-id). You need the store ID for operations with the Object Store v2 API. ## Get a Bearer Token to Use with the Object Store v2 APIs If MFA (multi-factor authentication) is enabled Use a connected app to get the bearer token: 1. [Configure a connected app](https://docs.mulesoft.com/object-store/osv2-connected-apps). Assign the connected app the Organization Administrator scope to access the organization and environment queries. 2. From the **Connected Apps** page, click **Copy Id** and **Copy Secret** for the app you just created. Use this client ID and client secret to get the bearer token required to authenticate with the Object Store v2 API. 3. Run this command to get the bearer token from the connected app client ID and client secret: ```bash curl --location '/accounts/api/v2/oauth2/token' \ --header 'Content-Type: application/json' \ --data '{ "client_id": "", "client_secret": "", "grant_type": "client_credentials" }' ``` Replace AUTH\_SERVER\_HOST with the URL of the authorization server, for example `https://anypoint.mulesoft.com/`. The output includes the bearer token: ```json { "access_token": "", "token_type": "bearer" } ``` 4. Use this bearer token to access any Object Store v2 API that requires a bearer token. If MFA isn’t enabled Authenticate with the credentials of a user with the Organization Administrator permission: 1. Run this command to get the bearer token: ```bash curl -H \ "Content-Type: application/json" \ -X POST -d '{"username":"","password":""}' \ "accounts/login" ``` Replace AUTH\_SERVER\_HOST with the URL of the authorization server, for example `https://anypoint.mulesoft.com/`. Make sure the user has the Organization Administrator permission to access the organization and environment queries. The output includes the bearer token: ```json { "access_token": "", "expires_in": 3600, "token_type": "bearer" } ``` 2. Use this bearer token to access any Object Store v2 API that requires a bearer token. ### Get the Organization ID and Environment ID To get the ORG\_ID, run this command, replacing AUTH\_SERVER\_HOST with the authorization server: ```bash curl -X GET https:///accounts/api/me \ -H "Authorization: Bearer " ``` The response includes output similar to: ```json "organization": { "name": "MyCompany", "id": "ORG_ID", }, ``` To get the ENV\_ID, run this command, replacing AUTH\_SERVER\_HOST with the authorization server: ```bash curl -X GET https:///accounts/api/organizations//environments \ -H "Authorization: Bearer " ``` The response includes output similar to: ```json "environments": [ { "id": "ENV_ID", "name": "Production", "organizationId": "ORG_ID", }, ] ``` ### Get the Region ID To get the region ID (REGION\_ID), run this command, replacing [BASE\_URL](#access-osv2-api): ```bash curl -X GET \ 'https:///api/v1/organizations//regions' \ -H 'authorization: Bearer ' ``` See [Example: Retrieve a List of Regions](#example-retrieve-region). ### Get the Store ID To get the store ID (STORE\_ID), run this command, replacing [BASE\_URL](#access-osv2-api): ```bash curl -X GET \ 'https:///api/v1/organizations//environments//stores' \ -H 'authorization: bearer ' ``` See [Example: Retrieve a List of Object Stores](#example-retrieve-list). ## Object Store v2 API The Object Store v2 API reads and writes `key,list` values, which is different from Anypoint Connector for Object Store (Object Store Connector), which reads and writes in the `key,value` format. This table compares the Object Store REST API operations to Object Store Connector operations:
Object Store v2 APIObject Store v2 REST API OperationsObject Store Connector Operation

POST

  • Object Store

    • Object store TTL, in seconds

      The maximum TTL is 2592000 seconds (30 days).

      If the entryTtl value specified is greater than 30 days, the value defaults to 2592000 seconds (30 days), without returning an error.

    • Persistence property

    • Usage limits for each application or environment, including options for limits based on keys or size, and how to enforce them

  • Key and list (item) value

Store

GET

  • Get keys

  • Get item

  • Get items

  • Get all items

  • Get regions for an organization

Contains + Retrieve + Retrieve all keys + Retrieve and store (Retrieve part)

PUT

  • Put item as string

  • Put item as number

  • Put item as confirmable string

  • Put store

Store

DELETE

  • Remove object store

  • Delete key

  • Delete item

Remove

You can retrieve a maximum of 25 keys with each GET operation. ### Access the Object Store v2 API 1. [Get a Bearer Token to Use with the Object Store v2 APIs](#get-bearer-token). 2. Set up an application, such as Postman, to access the object store. 3. Configure the object store access URL, replacing ORG\_ID with your organization ID and ENV\_ID with your environment ID: ```bash /api/v1/organizations//environments//stores/myTestStoreId/objects ``` Depending on the deployment region, use one of these domains for the value of BASE\_URL in the access URL:
Control PlaneBASE_URLRegion

U.S.

object-store-us-east-1.anypoint.mulesoft.com

US East (N. Virginia)

object-store-us-east-2.anypoint.mulesoft.com

US East (Ohio)

object-store-us-west-1.anypoint.mulesoft.com

US West (N. California)

object-store-us-west-2.anypoint.mulesoft.com

US West (Oregon)

object-store-ap-southeast-1.anypoint.mulesoft.com

Asia Pacific (Singapore)

object-store-ap-southeast-2.anypoint.mulesoft.com

Asia Pacific (Sydney)

object-store-ap-northeast-1.anypoint.mulesoft.com

Asia Pacific (Tokyo)

object-store-ca-central-1.anypoint.mulesoft.com

Canada (Central)

object-store-eu-central-1.anypoint.mulesoft.com

Europe (Frankfurt)

object-store-eu-west-1.anypoint.mulesoft.com

Europe (Ireland)

object-store-eu-west-2.anypoint.mulesoft.com

UK (London)

object-store-sa-east-1.anypoint.mulesoft.com

South America (São Paulo)

U.S.

MuleSoft Government Cloud

object-store-us-gov-west-1.gov.anypoint.mulesoft.com

US Gov West

EU

object-store-eu-central-1.eu1.anypoint.mulesoft.com

Europe (Frankfurt)

object-store-eu-west-1.eu1.anypoint.mulesoft.com

Europe (Ireland)

Canada Cloud

object-store-ca-central-1.ca1.platform.mulesoft.com

Canada (Central)

Japan Cloud

object-store-ap-northeast-1.jp1.platform.mulesoft.com

Asia Pacific (Tokyo)

4. Configure the application with HTTP headers and body for values to store to or read from the object store. 5. Send the operation to the Object Store v2 API. ### Examples: Object Store v2 API - [Example: Retrieve a List of Object Stores](#example-retrieve-list) - [Example: Retrieve a List of Regions](#example-retrieve-region) - [Example: Retrieve a List of Partitions](#example-retrieve-partitions) - [Example: Retrieve a List of Keys in a Partition](#example-retrieve-keys) - [Example: Retrieve the Value of a Key](#example-retrieve-key-value) - [Example: Store a Key-Value Pair](#example-store-key-value) - [Example: Update a Key-Value Pair](#example-update-key-value) - [Example: Delete a Key and Value](#example-delete-key-value) #### Example: Retrieve a List of Object Stores To view the list of object stores, run a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, ENV\_ID with your environment ID, and BEARER\_TOKEN with your bearer token: ```bash curl -X GET \ 'https:///api/v1/organizations//environments//stores' \ -H 'authorization: bearer ' ``` This command returns output similar to: ```json {"values":[{"storeId":"APP_os-simple-flow__defaultPersistentObjectStore","encrypted":true,"permanentOsFlag":false, "persistent":true,"defaultTtlSeconds":2592000,"defaultConfirmationTtlSeconds":600,"isFixedTtl":null}, {"storeId":"APP_scheduler-tests__defaultPersistentObjectStore","encrypted":true,"permanentOsFlag":false, "persistent":true,"defaultTtlSeconds":2592000,"defaultConfirmationTtlSeconds":600,"isFixedTtl":null} {"storeId":"APP_sending-a-csv-file-thru-email-using-smtp__defaultPersistentObjectStore","encrypted":true,"permanentOsFlag":false, "persistent":true,"defaultTtlSeconds":2592000,"defaultConfirmationTtlSeconds":600,"isFixedTtl":null}],"nextPageToken":null} ``` #### Example: Retrieve a List of Regions To view the list of regions, submit a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, and BEARER\_TOKEN with your bearer token: ```bash curl -X GET \ 'https:///api/v1/organizations//regions' \ -H 'authorization: Bearer ' ``` This command returns output similar to: ```json [ { "id": "us-east-1", "name": "US East (N. Virginia)", "url": "http://object-store.us-east-1.anypoint.mulesoft.com" }, { "id": "us-west-1", "name": "US West (N. California)", "url": "http://object-store.us-west-1.anypoint.mulesoft.com" } ] ``` #### Example: Retrieve a List of Partitions To view the list of partitions, submit a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, ENV\_ID with your environment ID, and STORE\_ID with the `storeId` from the list of object stores, and BEARER\_TOKEN with your bearer token: ```bash curl -X GET \ https:///api/v1/organizations//environments//stores//partitions \ -H "Authorization: Bearer " ``` This command returns output similar to: ```json { "values": ["PARTITION_ID"], "nextPageToken": null } ``` #### Example: Retrieve a List of Keys in a Partition To view the keys in a partition, submit a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, ENV\_ID with your environment ID, STORE\_ID with the name of the object store, PARTITION\_ID with the name of the partition, and BEARER\_TOKEN with your bearer token: ```bash curl -X GET \ https:///api/v1/organizations//environments//stores//partitions//keys \ -H "Authorization: Bearer " ``` This command returns output similar to: ```json { "values": [{ "keyId": "KeyTwo" }, { "keyId": "KeyOne" }], "nextPageToken": null } ``` #### Example: Retrieve the Value of a Key To view the value of a key, submit a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, ENV\_ID with your environment ID, STORE\_ID with the name of the object store, PARTITION\_ID with the name of the partition, KEY\_ID with the key ID, and BEARER\_TOKEN with your bearer token: ```bash curl -X GET \ https:///api/v1/organizations//environments//stores//partitions//keys/ \ -H "Authorization: Bearer " ``` This command returns output similar to: ```json { "binaryValue": "++Kn0AIBAQBbwoABDiJLZXkgMiBWYWx1ZSL8rNmhAQEBAWphdmEuaW8uU2VyaWFsaXphYmzlgGFwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9VVRGLbgAAAAAAAAADQ==", "keyId": "KeyTwo", "valueType": "BINARY" } ``` #### Example: Store a Key-Value Pair To store a key-value pair, submit a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, ENV\_ID with your environment ID, STORE\_ID with the name of the object store, PARTITION\_ID with the name of the partition, BEARER\_TOKEN with your bearer token, and specify a value (`myTestKey`) for KEY\_ID: ```bash KEY_ID=myTestKey; \ curl -X POST \ https:///api/v1/organizations//environments//stores//partitions//keys/myTestKey \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ --data '{"stringValue":"Hello World","keyId":"myTestKey","valueType":"STRING"}' ``` In this command, the value is a JSON string. To verify that the key-pair is in the object store, get a list of the keys in the partition: ```bash curl -X GET \ https:///api/v1/organizations//environments//stores//partitions//keys \ -H "Authorization: Bearer " ``` This command returns output similar to: ```json { "values": [{ "keyId": "KeyTwo" }, { "keyId": "KeyOne" }, { "keyId": "myTestKey" }], "nextPageToken": null } ``` #### Example: Update a Key-Value Pair To update the value of an existing key or create a new one, use a `PUT` request. Replace the placeholders with your specific values: ```bash curl -X PUT \ 'https:///api/v1/organizations//environments//stores//partitions//keys/' \ -H 'authorization: bearer ' \ -H 'content-type: application/json' \ -d '{ "stringValue": "Updated value", "valueType": "STRING", "metadata": { "source": "api" } }' ``` This command returns output similar to: ```json { "stringValue": "Updated value", "valueType": "STRING", "metadata": { "source": "api" } } ``` #### Example: Delete a Key and Value To delete a key-value pair, submit a `curl` command, replacing BASE\_URL with the regional domain, ORG\_ID with your organization ID, ENV\_ID with your environment ID, STORE\_ID with the name of the object store, PARTITION\_ID with the name of the partition, KEY\_ID with the key ID, and BEARER\_TOKEN with your bearer token: ```bash curl -X DELETE \ https:///api/v1/organizations//environments//stores//partitions//keys/KEY_ID \ -H "Authorization: Bearer " ``` In this command, the value is a JSON string. To verify that the key-pair is no longer in the object store, get a list of the keys in the partition: ```bash curl -X GET \ https:///api/v1/organizations//environments//stores//partitions//keys \ -H "Authorization: Bearer " ``` This command returns output similar to: ```json { "values": [{ "keyId": "KeyTwo" }, { "keyId": "KeyOne" }], "nextPageToken": null } ``` ## Download Object Store APIs from Exchange To download the Object Store APIs from Exchange: 1. Go to Exchange and click **Download**. 2. Select the format to download: - RAML - OAS - Mule 4 connector file ![Download button for the Object Store v2 API in Exchange](/mulesoft/current/en-us/object-store/_images/os-exchange-download.png) ## See Also - [Rolling TTL](https://docs.mulesoft.com/object-store/#rolling-ttl) - [Object Store v2 API](https://dev-portal.mulesoft.com/apis/object-store-v2.html) - [Access Management API](https://dev-portal.mulesoft.com/apis/access-management.html) - [Object Store Connector for Mule 4](https://docs.mulesoft.com/object-store-connector/latest/) --- product: Object Store --- # Tutorial: Store and Retrieve Data from Object Store v2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Use this tutorial to configure Anypoint Connector for Object Store (Object Store Connector) in your app so that you can use Object Store v2 to store and view data. You can send any serializable data as key-value pairs to the object store. In this tutorial, you: - [Create a Mule 4.x app in Anypoint Studio 7.x](#create-app-studio7) and configure Object Store Connector for Mule 4 in the app. You then test your app by sending data to the object store and viewing it in Runtime Manager. ## Before You Begin Before you begin this tutorial, you must have: - Familiarity with Anypoint Studio, Anypoint Platform, and Runtime Manager - An [Anypoint Platform account](https://anypoint.mulesoft.com) If you don’t have an Anypoint Platform login, click **Sign up** on the Anypoint Platform sign-in page. - Anypoint Studio installed on your system. See [Download and Install Anypoint Studio](https://docs.mulesoft.com/studio/to-download-and-install-studio) - An [`curl` command line tool](https://curl.se/) for testing This tutorial uses the HTTP Listener source to initiate Object Store Connector access and a `curl` command to send JSON data to your Mule app. Instead of `curl`, you can use Postman or browser plugins. ## Create a Mule 4.x App with an Object Store in Anypoint Studio 7.x First, use Studio 7.x to configure an app that includes an HTTP Listener source and Object Store Connector. Then, deploy the app to CloudHub and use a `curl` command to send a key and value, and view the key in Runtime Manager. To configure a Mule 4.x app in Studio 7.x: 1. Start Studio, click **File** > **New** > **Mule Project**, and name the project `osv2-demo`. 2. Install Object Store Connector for Mule 4: 1. Click the **Exchange** icon in the toolbar: ![Studio 7.x window showing the Exchange icon in the toolbar](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-exchange.png) 2. Enter your Anypoint Platform username and password, if prompted. 3. In Exchange, select **Provided by MuleSoft** and **Connectors**, and then search for Object Store Connector: ![Exchange window showing the Provided by MuleSoft option and search field](/mulesoft/current/en-us/object-store/_images/os-tutorial-exchange.png) 4. Select **ObjectStore Connector - Mule 4**. 5. Click **Add to project**: ![Exchange window showing the Add to project icon](/mulesoft/current/en-us/object-store/_images/os-tutorial-exchange-add-to-project.png) 6. At the confirmation prompt, click **Proceed** and then click **OK**. 3. In the **Mule Palette** view, click **HTTP**, and then drag **Listener** to the Studio canvas: ![Mule Palette view showing the HTTP Connector and Listener operations](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-palette.png)
1HTTP Connector
2Listener operation
4. Click **ObjectStore** and then drag the **Store** operation to **Listener** on the canvas: ![Studio 7.x window showing the Store operation on the canvas](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-flow.png) 5. In the canvas, click **Listener**. 6. In the **Listener** properties window, set **General > Path** to `/store`. 7. Click the plus icon (+) for the **Connector configuration** field. 8. In the HTTP Listener **Global Element Properties** window, verify that the value of **Host** is `0.0.0.0` and **Port** is `8081`, and then click **OK**. The **Listener** properties window indicates that there are no errors: ![Listener properties window showing no errors](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-listener-props.png) 9. In the canvas, click the **Store** operation. 10. In the **Store** properties window, specify `#[payload.key]` in the **Key** field and `payload.value` in the **Value** field: ![Store properties windows showing the values in the Key and Value fields](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-store-props.png) The maximum number of characters in a key is 256. Object Store v2 for CloudHub doesn’t support using pipe (`|`) characters in keys and converts any spaces to plus (`+`) characters. 11. In the canvas, select the flow. 12. In the **Flow Configuration** properties window, change the name to `Store`: ![Flow Configuration properties window showing the Name field set to Store](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-store-flow-props.png) 13. In the **Mule Palette** view, click **HTTP** and then drag another **Listener** to the canvas after the first flow. 14. Click **ObjectStore** and then drag the **Retrieve** operation after to the **Listener** in the second flow. 15. In the canvas, click **Listener**. 16. In the **Listener** properties window, set **General > Path** to `/retrieve`. 17. In the **Connector configuration** menu, select the same **HTTP\_Listener\_config** option that you set up for the Listener operation in the Store flow: ![Listener properties window showing the Connector configuration menu](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-retrieve-listener-props.png) 18. In the canvas, click the **Retrieve** operation. 19. In the **Retrieve** properties window, specify `#[attributes.queryParams.key]` in the **Key** field: ![Retrieve properties window showing the value in the Key field](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-retrieve-props.png) 20. In the canvas, select the second flow and, in the **Flow Configuration** properties window, change the name to `Retrieve`. The flows look like this: ![Studio canvas showing the Store and Retrieve operation flows](/mulesoft/current/en-us/object-store/_images/os-tutorial-studio7-flows.png) 21. In **Package Explorer** in Studio, right-click `osv2-demo` and select **Anypoint Platform** > **Deploy to CloudHub**. 22. In the Runtime Manager **Deploying Application** window: 1. Select CloudHub from **Deployment Target**. 2. Click **Deploy Application**: ![Runtime Manager Deploying Application window showing the Deploy Application button](/mulesoft/current/en-us/object-store/_images/os-tutorial-deploy-app.png) 23. Click **Open in Browser** to display the app in Runtime Manager. If CloudHub displays a permissions error, select a different environment to deploy to. You have successfully used Studio 7 to configure an app with an object store. Next, you test the connection by submitting REST API commands to the Object Store API and using Runtime Manager to view the results. ### Test Your Studio 7.x Application After you create your app in Studio 7, you can test it by using a `curl` command to submit a REST API command to the Object Store API. Then, use Runtime Manager to view the results. To test your app: 1. In Runtime Manager, click **Applications** and ensure that the `osv2-demo` app is running. 2. Click the **Status** column for the `osv2-demo` app to display its details. 3. Copy the **App url** value: ![Runtime Manager app details pane showing the App url](/mulesoft/current/en-us/object-store/_images/os-tutorial-rtm-deploy-url.png) 4. From the command line, run this `curl` command, replacing _APP-URL_ with the **App url** value that you copied from Runtime Manager: ```console $ curl -X POST -H "Content-Type: application/json" -d '{ "key": "myKey", "value": "OSv2 Test" }' "http://APP-URL/store";echo ``` The output from this command displays the key-value pair that you sent to the object store: ```console { "key": "myKey", "value": "OSv2 Test" } ``` 5. In Runtime Manager, click **Manage application** in the details pane for the application: ![Runtime Manager app details pane showing the Manage application button](/mulesoft/current/en-us/object-store/_images/os-tutorial-rtm-manage-app.png) 6. Select **Object Store** from the sidebar. 7. Click the object store, the partition, and then the key: ![Runtime Manager window showing the selected object store, partition, and key](/mulesoft/current/en-us/object-store/_images/os-tutorial-rtm-key-in-os.png) The `myKey` key that you sent from `curl` appears in the object store with the value of `[binary value] BINARY`. The value is binary because Mule 4 wraps values in a Mule object, which causes them to be visible only as binary in Anypoint Platform. 8. From the command line, run this `curl` command to view the value for the key, replacing _APP-URL_ with the **App url** value that you copied from Runtime Manager: ```console curl http://APP-URL/retrieve?key=myKey;echo ``` The output from this command displays the value for the key: ```console "OSv2 Test" ``` You have successfully tested your app using a `curl` command to store and retrieve a key-value pair in the object store and viewed the results in Runtime Manager. ### Example App XML for Studio 7.x Click **Configuration XML** in Studio and compare your XML to this example. Make corrections if necessary. ```xml ``` ## See Also - [Anypoint Studio](https://docs.mulesoft.com/studio/) - [Object Store Connector for Mule 4](https://docs.mulesoft.com/object-store-connector/latest/) - [Deploy to CloudHub](https://docs.mulesoft.com/cloudhub/deploying-to-cloudhub) --- product: Object Store --- # Using Object Store v2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Object Store v2 (Object Store v2) enables you to share data and states across Mule runtime workers within a single application. Object Store v2 is enabled by default in Mule 4 and in Anypoint Platform EU Control Plane. ## Components Object Store v2 interacts with these components: - Anypoint Connector for Object Store (Object Store Connector) Use Object Store Connector with Anypoint Studio to construct flows to write to and read from the object store. Object Store Connector works with both Object Store version 1 and version 2. To use Object Store v2 with Mule 4 apps, ensure that you select the correct object store configuration reference from the **Object store** menu. - REST API The Object Store v2 API enables you to create and delete objects, set TTL (time to live) for objects, and set usage limits. - Anypoint Runtime Manager When you enable Object Store v2, the **Runtime Manager > Application Data** option changes to **Object Store**. From the **Object Store** page, you can manage objects and their values in the object store. ### Protect Object Store Data Object Store v2 uses TLS for secure transport. Data at rest is stored using FIPS 140-2-compliant encryption standards. If you require a higher level of security, encrypt sensitive data before writing it to the object store. ### Synchronize Access to Object Store v2 Using Object Store v2 with multi-worker CloudHub applications might result in data discrepancies or key clashes. To avoid these issues, use a distributed key-value store as a lock to synchronize access to Object Store v2. For information about distributed locking in Mule runtime engine, see [Distributed Locking](https://docs.mulesoft.com/mule-runtime/latest/distributed-locking). ## Add Object Store Connector to Your Mule 4 Project Install Object Store Connector to add it to a Mule project: 1. In Studio, create a Mule project. 2. In the **Mule Palette** view, click **(X) Search in Exchange**. 3. In **Add Dependencies to Project**, enter `Object Store` in the search field. 4. In **Available modules**, click **ObjectStore Connector - Mule 4** and click **Add**. 5. Click **Finish**. ## Use Object Store Connector in an Application 1. In Studio, create a simple flow such as: ![Flow in Studio showing the Listener and Store operations](/mulesoft/current/en-us/object-store/_images/os-studio7-flow.png)

Connector

Parameters

HTTP Listener

Connector configuration = HTTP_Listener_config

Path = /store

Object Store

Key = #[payload.key]

Value = [payload.value]

Object Store v2 for CloudHub doesn’t support using pipe (`|`) characters in keys and converts any spaces to plus (`+`) characters. > [!IMPORTANT] To use Object Store v2, ensure that the **Persistent** option is selected for the > object store configuration reference in the **Global Elements** page. If the XML includes > `persistent="false"`, the app does not use Object Store v2. 2. Save the application. 3. Right-click the application name in **Package Explorer** and select **Anypoint Platform > Deploy to CloudHub**. 4. If prompted, sign in to Anypoint Platform. 5. Click **Deploy Application** and click **Open in Browser**. 6. In Runtime Manager, click the **Status** column for your application. 7. In the details pane, copy the **App url** address. ## Send Data to an Object Store From a command line prompt, send JSON data to your Mule application using a `curl` command: curl -X POST -H "Content-Type: application/json" -d '{ "key": "TestKey01", "value": "Testing" }' "http://app-url/store" Change `app-url` to the name you copied from **App url** in Runtime Manager. ## View Data in an Object Store To view data in an object store: 1. In Runtime Manager, click the name of your application to view the dashboard. 2. Click **Object Store** in the navigation menu. 3. Click the object store, the partition, and then the key: ![Runtime Manager window showing the Object Store navigation menu, and the selected object store, partition, key, and key data](/mulesoft/current/en-us/object-store/_images/os-rtm-key-in-os.png)
1Object Store navigation menu
2Selected key
3Key data (binary value and type)
The `TestKey01` key that you sent from `curl` appears in the object store with the value `[binary value] BINARY`. The value is binary because Mule 4 wraps values in a Mule object, which causes them to be visible only as binary in Anypoint Platform. 4. To delete a key, hover over a key name and click the trash can icon. Similarly, you can delete a partition or the store itself by hovering over and clicking the trash can icon. > [!IMPORTANT] Do not delete object stores that are associated with a running app. To prevent > errors, stop the app before deleting an object store. The tutorial provides more detailed information about creating object stores in Mule 4 applications. ## Configure a Custom Time to Live Period A custom time to live (TTL) period applies to the partition defined in the object store configuration. For information how rolling TTL behaves, see [Rolling TTL](https://docs.mulesoft.com/object-store/#rolling-ttl). To configure a custom TTL period for keys stored in the object store: 1. Create an app that uses Mule runtime engine version 4.2.1 or later. 2. Configure the object store in the app. 3. Select the **Store** operation in the flow and, in the properties window, click the green plus icon (+) for the **Object store** field: ![Studio properties window for the Store operation showing the green plus icon](/mulesoft/current/en-us/object-store/_images/os-use-ttl-props.png) 4. Configure the TTL entries in the **Global Object Store Configuration** window: ![Global Object Store Configuration window showing the Entry ttl field](/mulesoft/current/en-us/object-store/_images/os-use-ttl-global-props.png) > [!NOTE] For Object Store v2, the **Max entries** field isn’t configurable. - **Entry ttl** For Mule 4.2.1 and later, enter a custom TTL value of 0 through 2592000 seconds (30 days). If **Entry ttl** isn’t empty, the TTL is static. If you leave this field empty, you enable rolling TTL; if you exceed 2592000 seconds, the TTL defaults to 2592000 seconds. For Mule versions earlier than 4.2.1, leave this field empty to set the TTL to 2592000 seconds. - **Entry ttl unit** Specify the TTL time interval, such as MINUTES. - **Expiration interval** Specify how frequently to run the expiration thread. Set this parameter to a positive value that is less than the **Entry ttl** value. If this field is blank or the value is less than or equal to zero, Object Store v2 ignores **Entry ttl**. - **Expiration interval unit** Specify the expiration interval time unit, such as MINUTES. 5. Click **OK** to dismiss the window. ## Create Object Store Partitions You can use _partitions_ to associate multiple object stores with an app. To create partitions in Object Store v2: 1. Create an app and add a Store operation to the flow. 2. Configure the Store operation. 3. Configure the partitions: 1. In the properties window, click the green plus icon (+) for the **Object store** field: ![Studio properties window for the Store operation showing the green plus icon](/mulesoft/current/en-us/object-store/_images/os-use-ttl-props.png) 2. In the **Global Element Properties** window, click the green plus icon (+) for **Configuration Reference** to create a global object store configuration: ![Global Element Properties window showing the green plus icon for the Configuration Reference field](/mulesoft/current/en-us/object-store/_images/os-use-partition-studio7-os-global-props.png) 3. Name the object store configuration and click **OK**. 4. Ensure that the correct configuration reference is selected and click **OK**. 5. Ensure that the correct object store is selected and click **OK**. 4. Repeat Step 3 for each partition that you want to create. 5. Deploy the app to CloudHub and send a key-value pair to the object store. 6. In Runtime Manager, click **Applications**, select the app, and click **Object Store** in the left navigation pane. 7. Select the object store. The partitions associated with the object store appear in the **Object Store** page: ![Runtime Manager window showing Partitions in the Object Store page](/mulesoft/current/en-us/object-store/_images/os-use-partitions-rtm.png) ## Deploy App with Object Store v2 Using the Mule Maven Plugin If you are using a Mule Maven plugin version between 3.3.3 and 3.4.0 to deploy your app to CloudHub: 1. Add the `` element to your `pom.xml` project file: ```xml ... true ... ``` 2. Select **Use Object Store v2** in the **Deploy Application** page in Runtime Manager. ## See Also - [Tutorial: Object Store v2](https://docs.mulesoft.com/object-store/osv2-tutorial) - [Rolling TTL](https://docs.mulesoft.com/object-store/#rolling-ttl) - [What are the advantages of using partitions?](https://docs.mulesoft.com/object-store/osv2-faq#what-are-the-advantages-of-using-partitions) - [Object Store v2 API](https://dev-portal.mulesoft.com/apis/object-store-v2.html) - [Object Store v2 Release Notes](https://docs.mulesoft.com/release-notes/object-store/anypoint-osv2-release-notes) - [Object Store Connector for Mule 4](https://docs.mulesoft.com/object-store-connector/latest/) - [Deploy Applications to CloudHub](https://docs.mulesoft.com/mule-runtime/latest/deploy-to-cloudhub)