Create an online store instance

To set up online serving, you need to first create an online store instance forBigtable online serving or Optimized online serving.To understand the differences between Bigtable online serving and Optimized online serving,seeOnline serving types.

Note that you can't change the type of online serving after you chooseBigtable online serving or Optimized online serving while creatingyour online store. However, you can change the serving endpoint configurationfor an online store instance created for Optimized online serving.

After you create the online store, you canadd feature viewsand associate those feature views with feature data sources in BigQuery.

You can encrypt your online store instance by specifying acustomer-managed encryption key (CMEK)when you create your online store instance.Only Bigtable online serving supports encryption using a CMEK.To learn more about the benefits of using a CMEK and to understand whethera CMEK is useful for your online store, seeBenefits of CMEK.

Using a CMEK can involve additional usage costs, depending on thetype of key being used. For more information about pricing, refer toCloud Key Management Service pricing.

Before you begin

Authenticate toVertex AI, unless you've done so already.

Select the tab for how you plan to use the samples on this page:

Console

When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

Python

To use the Python samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.

    Install the Google Cloud CLI.

    If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

    If you're using a local shell, then create local authentication credentials for your user account:

    gcloudauthapplication-defaultlogin

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

For more information, see Set up authentication for a local development environment.

REST

To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.

    Install the Google Cloud CLI.

    If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.

Create an online store for Bigtable online serving

When you use Bigtable online serving, you have the option to encrypt the online store using aCMEK.

Create an online store for Bigtable online serving without CMEK

To create an online store instance forBigtable online serving with autoscaling, without specifying a CMEK, usethe Google Cloud console or the REST API.

Note: Bigtable online serving doesn't support embeddings. If you want to serve embeddings,create an online store for Optimized online serving instead.

Console

Use the following instructions to create an online store for Bigtable online serving using the Google Cloud console.

  1. In the Vertex AI section of the Google Cloud console, go to theFeature Store page.

    Go to the Feature Store page

  2. ClickOnline store to go to theOnline store section.

  3. ClickCreate to open theCreate Online Store page.

  4. Specify a name for the online store.

  5. Optional: To add labels, clickAdd label, and specify the label name and value. You can add multiple labels to an online store.

  6. In theChoose a storage solution for your online store field, clickBigtable.

  7. Modify theMinimum node count,Maximum node count, andCPU utilization target, as needed.

  8. ClickCreate.

Python

To learn how to install or update the Vertex AI SDK for Python, seeInstall the Vertex AI SDK for Python. For more information, see thePython API reference documentation.

fromgoogle.cloudimportaiplatformfromvertexai.resources.previewimportfeature_storedefcreate_bigtable_feature_online_store_sample(project:str,location:str,feature_online_store_id:str,):aiplatform.init(project=project,location=location)fos=feature_store.FeatureOnlineStore.create_bigtable_store(feature_online_store_id)returnfos
  • project: Your project ID.
  • location: Region where the online store is located, such asus-central1.
  • feature_online_store_id: The name of the newFeatureOnlineStore instance.

REST

To create aFeatureOnlineStore resource, send aPOST request by using thefeatureOnlineStores.createmethod.

Before using any of the request data, make the following replacements:

  • LOCATION_ID: Region where you want to create the online store, such asus-central1.
  • PROJECT_ID: Your project ID.
  • FEATUREONLINESTORE_NAME: The name of the new online store instance.
  • BOOLEAN: Optional: To create an online store that supports embedding management, entertrue. The default value isfalse.

HTTP method and URL:

POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME

Request JSON body:

{  "bigtable": {    "auto_scaling": {      "min_node_count": 1,      "max_node_count": 3,      "cpu_utilization_target": 50    }  }}

To send your request, choose one of these options:

curl

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME"

PowerShell

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/operations/OPERATION_ID",  "metadata": {    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.CreateFeatureOnlineStoreOperationMetadata",    "genericMetadata": {      "createTime": "2023-09-18T17:49:23.847496Z",      "updateTime": "2023-09-18T17:49:23.847496Z"    }  }}

Create an online store that uses a CMEK

Use the following steps to create an online store instance forBigtable online serving that's encrypted with a CMEK.

Using a CMEK encryption can involve additional usage costs, depending on thetype of key being used. For more information about pricing, refer toCloud Key Management Service pricing.

Note: Bigtable online serving doesn't support embeddings. If you want to serve embeddings,create an online store for Optimized online serving instead.
  1. Use Cloud Key Management Service to configure a customer-managed encryptionkey.

  2. To create aFeatureOnlineStoreresource, send the followingPOST request by using thefeatureOnlineStores.createmethod and specifying the CMEK.

    Before using any of the request data, make the following replacements:

    • LOCATION_ID: Region where you want to create the online store, such asus-central1.
    • PROJECT_ID: Your project ID.
    • FEATUREONLINESTORE_NAME: The name of the new online store instance.
    • BOOLEAN: Optional: To create an online store that supports embedding management, entertrue. The default value isfalse.
    • KEY_NAME: The name of the encryption key that you want to use for this metadata store.

    HTTP method and URL:

    POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME

    Request JSON body:

    {  "bigtable": {    "auto_scaling": {      "min_node_count": 1,      "max_node_count": 3,      "cpu_utilization_target": 50    }  },  "encryption_spec": {    "kms_key_name": "KEY_NAME"  }}

    To send your request, choose one of these options:

    curl

    Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

    Save the request body in a file namedrequest.json, and execute the following command:

    curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    -d @request.json \
    "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME"

    PowerShell

    Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

    Save the request body in a file namedrequest.json, and execute the following command:

    $cred = gcloud auth print-access-token
    $headers = @{ "Authorization" = "Bearer $cred" }

    Invoke-WebRequest `
    -Method POST `
    -Headers $headers `
    -ContentType: "application/json; charset=utf-8" `
    -InFile request.json `
    -Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME" | Select-Object -Expand Content

    You should receive a JSON response similar to the following:

    {  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/operations/OPERATION_ID",  "metadata": {    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.CreateFeatureOnlineStoreOperationMetadata",    "genericMetadata": {      "createTime": "2023-09-18T17:49:23.847496Z",      "updateTime": "2023-09-18T17:49:23.847496Z"    }  }}

Create an online store for Optimized online serving

When you use Optimized online serving, you can configure the online storeto serve features from either a public endpoint or a dedicatedPrivate Service Connect endpoint. Use aPrivate Service Connect endpoint if you want to serve featureswithin a VPC network at lower latencies than a public endpoint.

Create an online store for Optimized online serving with a public endpoint

Use the following samples to create an online store for Optimized online serving with a public endpoint.

Console

Use the following instructions to create an online store for Optimized online serving using the Google Cloud console.

  1. In the Vertex AI section of the Google Cloud console, go to theFeature Store page.

    Go to the Feature Store page

  2. ClickOnline store to go to theOnline store section.

  3. ClickCreate to open theCreate Online Store page.

  4. Specify a name for the online store.

  5. Optional: To add labels, clickAdd label, and specify the label name and value. You can add multiple labels to an online store.

  6. In theChoose a storage solution for your online store field, clickOptimized.

  7. ClickCreate.

Python

To learn how to install or update the Vertex AI SDK for Python, seeInstall the Vertex AI SDK for Python. For more information, see thePython API reference documentation.

fromgoogle.cloudimportaiplatformfromvertexai.resources.previewimportfeature_storedefcreate_optimized_public_feature_online_store_sample(project:str,location:str,feature_online_store_id:str,):aiplatform.init(project=project,location=location)fos=feature_store.FeatureOnlineStore.create_optimized_store(feature_online_store_id)returnfos
  • project: Your project ID.
  • location: Region where you want to create theFeatureOnlineStore instance, such asus-central1.
  • feature_online_store_id: The name of the newFeatureOnlineStore instance.

REST

To create an online store instance, send aPOST request by using thefeatureOnlineStores.createmethod.

Before using any of the request data, make the following replacements:

  • LOCATION_ID: Region where you want to create theFeatureOnlineStore instance, such asus-central1.
  • PROJECT_ID: Your project ID.
  • FEATUREONLINESTORE_NAME: The name of the newFeatureOnlineStore instance.

HTTP method and URL:

POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME

Request JSON body:

{  "optimized": {}}

To send your request, choose one of these options:

curl

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME"

PowerShell

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/operations/OPERATION_ID",  "metadata": {    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.CreateFeatureOnlineStoreOperationMetadata",    "genericMetadata": {      "createTime": "2023-09-18T17:49:23.847496Z",      "updateTime": "2023-09-18T17:49:23.847496Z"    }  }}

Create an online store for Optimized online serving with a Private Service Connect endpoint

Use the following samples to create an online store for Optimized online serving withPrivate Service Connect.

Python

To learn how to install or update the Vertex AI SDK for Python, seeInstall the Vertex AI SDK for Python. For more information, see thePython API reference documentation.

fromtypingimportListfromgoogle.cloudimportaiplatformfromvertexai.resources.previewimportfeature_storedefcreate_optimized_private_feature_online_store_sample(project:str,location:str,feature_online_store_id:str,project_allowlist:List[str],):aiplatform.init(project=project,location=location)fos=feature_store.FeatureOnlineStore.create_optimized_store(name=feature_online_store_id,enable_private_service_connect=True,project_allowlist=project_allowlist,)returnfos
  • project: Your project ID.
  • location: Region where you want to create theFeatureOnlineStore instance, such asus-central1.
  • feature_online_store_id: The name of the newFeatureOnlineStore instance.
  • project_allowlist: The list of project names to be allowlisted for private service connect (PSC).

REST

To create an online store instance, send aPOST request by using thefeatureOnlineStores.createmethod.

Before using any of the request data, make the following replacements:

  • LOCATION_ID: Region where you want to create theFeatureOnlineStore instance, such asus-central1.
  • PROJECT_ID: Your project ID.
  • FEATUREONLINESTORE_NAME: The name of the newFeatureOnlineStore instance.
  • PROJECT_NAMES: The list of project names to be allowlisted for private service connect (PSC).

HTTP method and URL:

POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME

Request JSON body:

{  "optimized": {},  "dedicated_serving_endpoint": {    "private_service_connect_config": {      "enable_private_service_connect": true,      "project_allowlist": ["PROJECT_NAMES"]    }  }}

To send your request, choose one of these options:

curl

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME"

PowerShell

Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.

Save the request body in a file namedrequest.json, and execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureOnlineStores?feature_online_store_id=FEATUREONLINESTORE_NAME" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureOnlineStores/FEATUREONLINESTORE_NAME/operations/OPERATION_ID",  "metadata": {    "@type": "type.googleapis.com/google.cloud.aiplatform.v1.CreateFeatureOnlineStoreOperationMetadata",    "genericMetadata": {      "createTime": "2023-09-18T17:49:23.847496Z",      "updateTime": "2023-09-18T17:49:23.847496Z"    }  }}

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.