Create an online store instance

To set up online serving, you need to first create an online store instance for Bigtable online serving or Optimized online serving.

Note that you can't change the type of online serving after you choose Bigtable online serving or Optimized online serving while creating your online store. However, you can change the serving endpoint configuration for an online store instance created for Optimized online serving.

After you create the online store, you can add feature views and associate those feature views with feature data sources in BigQuery.

Configure embedding management for an online store

Vertex AI Feature Store lets you perform vector similarity searches using embeddings in a feature view within an online store. To perform a vector similarity search, you need to configure your online store instance to support embedding management by using the FeatureOnlineStore.embedding_management parameter, and then configure vector retrieval for at least one feature view within the online store.

For more information about how to search for approximate nearest neighbors using embeddings in Vertex AI Feature Store, see Search using embeddings.

Create an online store for Bigtable online serving

Use the following samples to create an online store instance for Bigtable online serving with autoscaling.

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 the Feature Store page.

    Go to the Feature Store page

  2. Click Online store to go to the Online store section.

  3. Click Create to open the Create Online Store page.

  4. Specify a name for the online store.

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

  6. In the Choose a storage solution for your online store field, click Bigtable.

  7. Modify the Minimum node count, Maximum node count, and CPU utilization target, as needed.

  8. Click Create.

REST

To create a FeatureOnlineStore resource, send a POST request by using the featureOnlineStores.create method.

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

  • LOCATION_ID: Region where you want to create the online store, such as us-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, enter true. The default value is false.

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
    }
  }
  "embedding_management": {
    "enabled": BOOLEAN
  }
}

To send your request, choose one of these options:

curl

Save the request body in a file named request.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

Save the request body in a file named request.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 store to serve features from either a public endpoint or a dedicated Private Service Connect endpoint. Use a Private Service Connect endpoint if you want to serve features within 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.

Web UI

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 the Feature Store page.

    Go to the Feature Store page

  2. Click Online store to go to the Online store section.

  3. Click Create to open the Create Online Store page.

  4. Specify a name for the online store.

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

  6. In the Choose a storage solution for your online store field, click Optimized.

  7. Click Create.

REST

To create an online store instance, send a POST request by using the featureOnlineStores.create method.

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

  • LOCATION_ID: Region where you want to create the FeatureOnlineStore instance, such as us-central1.
  • PROJECT_ID: Your project ID.
  • FEATUREONLINESTORE_NAME: The name of the new FeatureOnlineStore 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

Save the request body in a file named request.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

Save the request body in a file named request.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 sample to create an online store for Optimized online serving with Private Service Connect.

REST

To create an online store instance, send a POST request by using the featureOnlineStores.create method.

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

  • LOCATION_ID: Region where you want to create the FeatureOnlineStore instance, such as us-central1.
  • PROJECT_ID: Your project ID.
  • FEATUREONLINESTORE_NAME: The name of the new FeatureOnlineStore 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": {},
  "dedicated_serving_endpoint": {
    "private_service_connect_config": {
      "enable_private_service_connect": true,
      "project_allowlist": ["PROJECT_NAME"]
    }
  }
}

To send your request, choose one of these options:

curl

Save the request body in a file named request.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

Save the request body in a file named request.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