All Products
Search
Document Center

Function Compute:Access other services

Last Updated:Jan 13, 2026

Function Compute is an event-driven, fully managed computing service that often relies on middleware such as databases or message queues for data persistence, data sharing, and message processing.

Database access mechanism

In Function Compute, instances of different execution environments do not share status. You can achieve status sharing by persisting structured data in a database. Through Function Compute, you can access cloud databases to perform operations such as data queries and insertions.

You can access a database via the Internet or a virtual private cloud (VPC). For enhanced security, we recommend accessing database resources through a VPC, ensuring data transmission within Alibaba Cloud's VPC.

  • Access the database over the Internet

    Allow data access over the Internet. In scenarios such as development or testing, you can assign a static public IP address in the function configuration to enable database access over the Internet. You must add the static public IP address to the database's whitelist to gain access.

  • Access a database over a VPC

    In a production environment, it's recommended to host the database within a secure VPC. Configure the function to access resources within the VPC and add the VPC's network segment to the database's access whitelist for secure cloud database access through the VPC.

The process for Function Compute to access a database through a VPC is illustrated in the following diagram.

image
  1. The client sends a request to Function Compute.

  2. Function Compute accesses the specified VPC database according to the network settings configured.

    You can set the function network in the Function Compute console configuration, or configure VPC resources for the function through the YAML file of Serverless Devs.

  3. After retrieving the data, Function Compute returns it to the client.