Traditionally, running AI, machine learning, or large-scale data analytics tasks in a database requires moving data to an external computing cluster. This process increases architectural complexity and adds data transfer costs and latency. PolarDB for MySQL integrate a Ray application (known as PolarDB Ray), which allows you to run these complex workloads directly within the database using the Python ecosystem and the Ray distributed computing framework. This significantly improves data processing and AI inference efficiency while effectively reducing costs.
Overview
Ray is an open-source distributed computing framework designed for large-scale AI and Python applications. PolarDB features a built-in Ray application that tightly integrates this powerful computing capability with the database. This means you can write and execute Python code directly in the database, using rich AI/ML libraries such as Pandas, NumPy, Scikit-learn, and PyTorch to process data stored in the database. Whether you are performing model training, data preprocessing, or complex vector computation, everything can be done within the database without moving data between the database and external computing environments.
Advantages
-
Serverless architecture: Provides steady-state nodes that never scale in to support consistent workloads. Meanwhile, agile nodes automatically scale based on real-time traffic, balancing stability and cost-efficiency.
-
High availability: The Ray Head node supports high availability and disaster recovery, ensuring stable cluster operation.
-
Security and reliability:
-
Provides runtime isolation through secure containers to ensure a secure code execution environment.
-
Supports multi-tenant isolation to prevent data leakage between tenants.
-
Ray Dashboard and Ray Job submissions support username/password and JWT authentication to prevent unauthorized access.
-
-
Integrated metadata management: The service runs in the same Virtual Private Cloud (VPC) as your PolarDB cluster. Metadata processed by PolarDB Ray can be stored directly in the PolarDB cluster, enabling seamless data exchange without additional network configuration.
-
Unified resource pool: Provides a unified CPU resource pool and supports GPU Worker, offering flexible resource support for diverse computing tasks.
-
Storage service: Supports mounting the high-performance edition of PolarDB File System 2.0, enabling direct data read and write through a file interface.
-
Open-source customization: As a downstream project of open-source Ray, PolarDB Ray is seamlessly compatible with the open-source Ray ecosystem while providing customized optimizations and enhancements for developers.
Scope of application
Only What is Multi-Master Cluster (Limitless) does not support creating a Ray application. All other product editions and series support this feature.
Billing
-
Component fee: A Ray application is billed separately for its Head node and each Worker node. The cost is calculated based on the component specifications (CPU and memory) and the purchase duration you select.
-
Storage fee: Data and files generated by the Ray application are not billed additionally. However, data that a Ray Job writes to a PolarDB for MySQL cluster or to PolarDB File System storage is subject to storage space fees.
-
Traffic and bandwidth: No fee.
Getting started
-
Create Ray Application: Quickly create a Ray application (known as PolarDB Ray) using an existing or new cluster.
-
Ray application configuration: Configure security settings for your Ray application, obtain the connection address and application parameters, and optionally enable public network access.
-
Using Ray Notebook: Learn how to access the built-in Ray Notebook in your Ray application and run a simple distributed application.
-
Submit a job to a Ray application: Learn how to submit and execute a Ray job in your Ray application using various methods including JupyterLab, Python SDK, and CLI.