全部产品
Search
文档中心

云原生数据库 PolarDB:什么是Ray应用

更新时间:Aug 12, 2026

当需要在数据库中执行AI、机器学习或大规模数据分析任务时,传统方法通常要求将数据迁移至外部计算集群。这一过程不仅增加了系统架构的复杂性,还带来了额外的数据传输成本和延迟。PolarDB MySQL版集成了Ray应用(即PolarDB Ray),使您能够直接在数据库内部利用Python生态和Ray分布式计算框架执行这些复杂任务,从而显著提升数据处理和人工智能推理的效率,并有效降低成本。

功能简介

Ray是一个开源的分布式计算框架,专为大规模AI和Python应用而设计。PolarDB通过内置Ray应用,将这个强大的计算能力与数据库深度融合。这意味着您可以直接在数据库中编写和执行Python代码,利用Pandas、NumPy、Scikit-learn、PyTorch等丰富的AI/ML库来处理存储在数据库中的数据。无论是进行模型训练、数据预处理,还是执行复杂的向量计算,都可以在数据库内一站式完成,无需在数据库和外部计算环境之间来回移动数据。

优势

  • Serverless架构:提供永不缩容的稳态节点,以支撑常态业务。同时,敏态节点能够根据实时流量自动进行伸缩,兼顾稳定性与成本效益。

  • 高可用:Ray Head节点支持高可用容灾能力,确保集群的稳定运行。

  • 安全可靠:

    • 通过安全容器提供运行时隔离,保障代码执行环境的安全。

    • 支持多租户隔离,防止租户间信息泄露。

    • Ray Dashboard和Ray Job提交均支持用户名/密码及JWT鉴权,防止未授权访问。

  • 一体化元数据管理:与PolarDB集群处于同一专有网络VPC下,基于PolarDB Ray处理的元数据可直接存储在PolarDB集群中,无需额外网络配置即可实现数据交互。

  • 统一资源池:提供统一的CPU资源池,并支持GPU Worker,为不同类型的计算任务提供灵活的资源支持。

  • 存储服务:支持挂载PolarDB文件系统2.0高性能版存储,可通过文件接口直接读写数据。

  • 开源定制:PolarDB Ray作为开源Ray的下游,与开源Ray生态实现无缝兼容。同时,为开发者提供定制化的优化与增强服务。

适用范围

仅什么是多主集群(Limitless)不支持,其他产品版本与系列均已支持创建Ray应用。

费用说明

  • 组件费用:Ray应用分别收取其Head节点和每个Worker节点的费用,费用根据您选择的组件规格(CPU和内存)和购买时长计算。

    单个组件价格信息

    中国内地

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    37.59

    0.0753

    polar.app.g4.medium
    2核8 GB

    40.60

    0.0810

    polar.app.g2.large
    4核8 GB

    71.43

    0.1433

    polar.app.g4.large
    4核16 GB

    94.74

    0.1896

    polar.app.g2.xlarge
    8核16 GB

    150.38

    0.3010

    polar.app.g4.xlarge
    8核32 GB

    186.47

    0.3734

    polar.app.g2.2xlarge
    16核32 GB

    300.75

    0.6035

    polar.app.g4.2xlarge
    16核64 GB

    360.90

    0.7236

    polar.app.g2.4xlarge
    32核64 GB

    601.50

    1.2041

    polar.app.g4.4xlarge
    32核128 GB

    649.62

    1.2967

    polar.app.g4.6xlarge
    48核192 GB

    902.26

    1.8061

    polar.app.g8.6xlarge
    48核384 GB

    974.44

    1.9450

    polar.app.g2.8xlarge
    64核128 GB

    1,203.01

    2.4081

    polar.app.g4.8xlarge
    64核256 GB

    1,299.25

    2.5933

    polar.app.g8.8xlarge
    64核512 GB

    2,117.29

    4.2431

    polar.app.g8.12xlarge
    88核710 GB

    2,911.28

    5.8336

    polar.app.g8.15xlarge
    120核920 GB

    3,969.92

    7.9566

    polar.app.g8.23xlarge
    180核1800 GB

    5,954.89

    11.9334

    中国(香港)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    60.15

    0.1204

    polar.app.g4.medium
    2核8 GB

    64.96

    0.1297

    polar.app.g2.large
    4核8 GB

    114.29

    0.2292

    polar.app.g4.large
    4核16 GB

    151.58

    0.3033

    polar.app.g2.xlarge
    8核16 GB

    240.60

    0.4819

    polar.app.g4.xlarge
    8核32 GB

    298.35

    0.5977

    polar.app.g2.2xlarge
    16核32 GB

    481.20

    0.9653

    polar.app.g4.2xlarge
    16核64 GB

    577.44

    1.1577

    polar.app.g2.4xlarge
    32核64 GB

    962.41

    1.9262

    polar.app.g4.4xlarge
    32核128 GB

    1,039.40

    2.0753

    polar.app.g4.6xlarge
    48核192 GB

    1,443.61

    2.8900

    polar.app.g8.6xlarge
    48核384 GB

    1,559.10

    3.1114

    polar.app.g2.8xlarge
    64核128 GB

    1,924.81

    3.8524

    polar.app.g4.8xlarge
    64核256 GB

    2,078.80

    4.1491

    polar.app.g8.8xlarge
    64核512 GB

    3,387.67

    6.7887

    polar.app.g8.12xlarge
    88核710 GB

    4,658.05

    9.3343

    polar.app.g8.15xlarge
    120核920 GB

    6,351.88

    12.7308

    polar.app.g8.23xlarge
    180核1800 GB

    9,527.82

    19.0941

    日本(东京)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    60.15

    0.1204

    polar.app.g4.medium
    2核8 GB

    64.96

    0.1297

    polar.app.g2.large
    4核8 GB

    114.29

    0.2292

    polar.app.g4.large
    4核16 GB

    151.58

    0.3033

    polar.app.g2.xlarge
    8核16 GB

    240.60

    0.4819

    polar.app.g4.xlarge
    8核32 GB

    298.35

    0.5977

    polar.app.g2.2xlarge
    16核32 GB

    481.20

    0.9653

    polar.app.g4.2xlarge
    16核64 GB

    577.44

    1.1577

    polar.app.g2.4xlarge
    32核64 GB

    962.41

    1.9262

    polar.app.g4.4xlarge
    32核128 GB

    1,039.40

    2.0753

    polar.app.g4.6xlarge
    48核192 GB

    1,443.61

    2.8900

    polar.app.g8.6xlarge
    48核384 GB

    1,559.10

    3.1114

    polar.app.g2.8xlarge
    64核128 GB

    1,924.81

    3.8524

    polar.app.g4.8xlarge
    64核256 GB

    2,078.80

    4.1491

    polar.app.g8.8xlarge
    64核512 GB

    3,387.67

    6.7887

    polar.app.g8.12xlarge
    88核710 GB

    4,658.05

    9.3343

    polar.app.g8.15xlarge
    120核920 GB

    6,351.88

    12.7308

    polar.app.g8.23xlarge
    180核1800 GB

    9,527.82

    19.0941

    韩国

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    60.15

    0.1204

    polar.app.g4.medium
    2核8 GB

    64.96

    0.1297

    polar.app.g2.large
    4核8 GB

    114.29

    0.2292

    polar.app.g4.large
    4核16 GB

    151.58

    0.3033

    polar.app.g2.xlarge
    8核16 GB

    240.60

    0.4819

    polar.app.g4.xlarge
    8核32 GB

    298.35

    0.5977

    polar.app.g2.2xlarge
    16核32 GB

    481.20

    0.9653

    polar.app.g4.2xlarge
    16核64 GB

    577.44

    1.1577

    polar.app.g2.4xlarge
    32核64 GB

    962.41

    1.9262

    polar.app.g4.4xlarge
    32核128 GB

    1,039.40

    2.0753

    polar.app.g4.6xlarge
    48核192 GB

    1,443.61

    2.8900

    polar.app.g8.6xlarge
    48核384 GB

    1,559.10

    3.1114

    polar.app.g2.8xlarge
    64核128 GB

    1,924.81

    3.8524

    polar.app.g4.8xlarge
    64核256 GB

    2,078.80

    4.1491

    polar.app.g8.8xlarge
    64核512 GB

    3,387.67

    6.7887

    polar.app.g8.12xlarge
    88核710 GB

    4,658.05

    9.3343

    polar.app.g8.15xlarge
    120核920 GB

    6,351.88

    12.7308

    polar.app.g8.23xlarge
    180核1800 GB

    9,527.82

    19.0941

    新加坡

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    60.15

    0.1204

    polar.app.g4.medium
    2核8 GB

    64.96

    0.1297

    polar.app.g2.large
    4核8 GB

    114.29

    0.2292

    polar.app.g4.large
    4核16 GB

    151.58

    0.3033

    polar.app.g2.xlarge
    8核16 GB

    240.60

    0.4819

    polar.app.g4.xlarge
    8核32 GB

    298.35

    0.5977

    polar.app.g2.2xlarge
    16核32 GB

    481.20

    0.9653

    polar.app.g4.2xlarge
    16核64 GB

    577.44

    1.1577

    polar.app.g2.4xlarge
    32核64 GB

    962.41

    1.9262

    polar.app.g4.4xlarge
    32核128 GB

    1,039.40

    2.0753

    polar.app.g4.6xlarge
    48核192 GB

    1,443.61

    2.8900

    polar.app.g8.6xlarge
    48核384 GB

    1,559.10

    3.1114

    polar.app.g2.8xlarge
    64核128 GB

    1,924.81

    3.8524

    polar.app.g4.8xlarge
    64核256 GB

    2,078.80

    4.1491

    polar.app.g8.8xlarge
    64核512 GB

    3,387.67

    6.7887

    polar.app.g8.12xlarge
    88核710 GB

    4,658.05

    9.3343

    polar.app.g8.15xlarge
    120核920 GB

    6,351.88

    12.7308

    polar.app.g8.23xlarge
    180核1800 GB

    9,527.82

    19.0941

    马来西亚(吉隆坡)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    60.15

    0.1204

    polar.app.g4.medium
    2核8 GB

    64.96

    0.1297

    polar.app.g2.large
    4核8 GB

    114.29

    0.2292

    polar.app.g4.large
    4核16 GB

    151.58

    0.3033

    polar.app.g2.xlarge
    8核16 GB

    240.60

    0.4819

    polar.app.g4.xlarge
    8核32 GB

    298.35

    0.5977

    polar.app.g2.2xlarge
    16核32 GB

    481.20

    0.9653

    polar.app.g4.2xlarge
    16核64 GB

    577.44

    1.1577

    polar.app.g2.4xlarge
    32核64 GB

    962.41

    1.9262

    polar.app.g4.4xlarge
    32核128 GB

    1,039.40

    2.0753

    polar.app.g4.6xlarge
    48核192 GB

    1,443.61

    2.8900

    polar.app.g8.6xlarge
    48核384 GB

    1,559.10

    3.1114

    polar.app.g2.8xlarge
    64核128 GB

    1,924.81

    3.8524

    polar.app.g4.8xlarge
    64核256 GB

    2,078.80

    4.1491

    polar.app.g8.8xlarge
    64核512 GB

    3,387.67

    6.7887

    polar.app.g8.12xlarge
    88核710 GB

    4,658.05

    9.3343

    polar.app.g8.15xlarge
    120核920 GB

    6,351.88

    12.7308

    polar.app.g8.23xlarge
    180核1800 GB

    9,527.82

    19.0941

    印度尼西亚(雅加达)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    52.63

    0.1054

    polar.app.g4.medium
    2核8 GB

    56.84

    0.1135

    polar.app.g2.large
    4核8 GB

    100.00

    0.2006

    polar.app.g4.large
    4核16 GB

    132.63

    0.2654

    polar.app.g2.xlarge
    8核16 GB

    210.53

    0.4211

    polar.app.g4.xlarge
    8核32 GB

    261.05

    0.5224

    polar.app.g2.2xlarge
    16核32 GB

    421.05

    0.8452

    polar.app.g4.2xlarge
    16核64 GB

    505.26

    1.0130

    polar.app.g2.4xlarge
    32核64 GB

    842.11

    1.6860

    polar.app.g4.4xlarge
    32核128 GB

    909.47

    1.8148

    polar.app.g4.6xlarge
    48核192 GB

    1,263.16

    2.5282

    polar.app.g8.6xlarge
    48核384 GB

    1,364.21

    2.7236

    polar.app.g2.8xlarge
    64核128 GB

    1,684.21

    3.3719

    polar.app.g4.8xlarge
    64核256 GB

    1,818.95

    3.6310

    polar.app.g8.8xlarge
    64核512 GB

    2,964.21

    5.9407

    polar.app.g8.12xlarge
    88核710 GB

    4,075.79

    8.1664

    polar.app.g8.15xlarge
    120核920 GB

    5,557.89

    11.1389

    polar.app.g8.23xlarge
    180核1800 GB

    8,336.84

    16.7062

    菲律宾

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    52.63

    0.1054

    polar.app.g4.medium
    2核8 GB

    56.84

    0.1135

    polar.app.g2.large
    4核8 GB

    100.00

    0.2006

    polar.app.g4.large
    4核16 GB

    132.63

    0.2654

    polar.app.g2.xlarge
    8核16 GB

    210.53

    0.4211

    polar.app.g4.xlarge
    8核32 GB

    261.05

    0.5224

    polar.app.g2.2xlarge
    16核32 GB

    421.05

    0.8452

    polar.app.g4.2xlarge
    16核64 GB

    505.26

    1.0130

    polar.app.g2.4xlarge
    32核64 GB

    842.11

    1.6860

    polar.app.g4.4xlarge
    32核128 GB

    909.47

    1.8148

    polar.app.g4.6xlarge
    48核192 GB

    1,263.16

    2.5282

    polar.app.g8.6xlarge
    48核384 GB

    1,364.21

    2.7236

    polar.app.g2.8xlarge
    64核128 GB

    1,684.21

    3.3719

    polar.app.g4.8xlarge
    64核256 GB

    1,818.95

    3.6310

    polar.app.g8.8xlarge
    64核512 GB

    2,964.21

    5.9407

    polar.app.g8.12xlarge
    88核710 GB

    4,075.79

    8.1664

    polar.app.g8.15xlarge
    120核920 GB

    5,557.89

    11.1389

    polar.app.g8.23xlarge
    180核1800 GB

    8,336.84

    16.7062

    泰国(曼谷)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    52.63

    0.1054

    polar.app.g4.medium
    2核8 GB

    56.84

    0.1135

    polar.app.g2.large
    4核8 GB

    100.00

    0.2006

    polar.app.g4.large
    4核16 GB

    132.63

    0.2654

    polar.app.g2.xlarge
    8核16 GB

    210.53

    0.4211

    polar.app.g4.xlarge
    8核32 GB

    261.05

    0.5224

    polar.app.g2.2xlarge
    16核32 GB

    421.05

    0.8452

    polar.app.g4.2xlarge
    16核64 GB

    505.26

    1.0130

    polar.app.g2.4xlarge
    32核64 GB

    842.11

    1.6860

    polar.app.g4.4xlarge
    32核128 GB

    909.47

    1.8148

    polar.app.g4.6xlarge
    48核192 GB

    1,263.16

    2.5282

    polar.app.g8.6xlarge
    48核384 GB

    1,364.21

    2.7236

    polar.app.g2.8xlarge
    64核128 GB

    1,684.21

    3.3719

    polar.app.g4.8xlarge
    64核256 GB

    1,818.95

    3.6310

    polar.app.g8.8xlarge
    64核512 GB

    2,964.21

    5.9407

    polar.app.g8.12xlarge
    88核710 GB

    4,075.79

    8.1664

    polar.app.g8.15xlarge
    120核920 GB

    5,557.89

    11.1389

    polar.app.g8.23xlarge
    180核1800 GB

    8,336.84

    16.7062

    德国(法兰克福)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    52.63

    0.1054

    polar.app.g4.medium
    2核8 GB

    56.84

    0.1135

    polar.app.g2.large
    4核8 GB

    100.00

    0.2006

    polar.app.g4.large
    4核16 GB

    132.63

    0.2654

    polar.app.g2.xlarge
    8核16 GB

    210.53

    0.4211

    polar.app.g4.xlarge
    8核32 GB

    261.05

    0.5224

    polar.app.g2.2xlarge
    16核32 GB

    421.05

    0.8452

    polar.app.g4.2xlarge
    16核64 GB

    505.26

    1.0130

    polar.app.g2.4xlarge
    32核64 GB

    842.11

    1.6860

    polar.app.g4.4xlarge
    32核128 GB

    909.47

    1.8148

    polar.app.g4.6xlarge
    48核192 GB

    1,263.16

    2.5282

    polar.app.g8.6xlarge
    48核384 GB

    1,364.21

    2.7236

    polar.app.g2.8xlarge
    64核128 GB

    1,684.21

    3.3719

    polar.app.g4.8xlarge
    64核256 GB

    1,818.95

    3.6310

    polar.app.g8.8xlarge
    64核512 GB

    2,964.21

    5.9407

    polar.app.g8.12xlarge
    88核710 GB

    4,075.79

    8.1664

    polar.app.g8.15xlarge
    120核920 GB

    5,557.89

    11.1389

    polar.app.g8.23xlarge
    180核1800 GB

    8,336.84

    16.7062

    英国(伦敦)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    52.63

    0.1054

    polar.app.g4.medium
    2核8 GB

    56.84

    0.1135

    polar.app.g2.large
    4核8 GB

    100.00

    0.2006

    polar.app.g4.large
    4核16 GB

    132.63

    0.2654

    polar.app.g2.xlarge
    8核16 GB

    210.53

    0.4211

    polar.app.g4.xlarge
    8核32 GB

    261.05

    0.5224

    polar.app.g2.2xlarge
    16核32 GB

    421.05

    0.8452

    polar.app.g4.2xlarge
    16核64 GB

    505.26

    1.0130

    polar.app.g2.4xlarge
    32核64 GB

    842.11

    1.6860

    polar.app.g4.4xlarge
    32核128 GB

    909.47

    1.8148

    polar.app.g4.6xlarge
    48核192 GB

    1,263.16

    2.5282

    polar.app.g8.6xlarge
    48核384 GB

    1,364.21

    2.7236

    polar.app.g2.8xlarge
    64核128 GB

    1,684.21

    3.3719

    polar.app.g4.8xlarge
    64核256 GB

    1,818.95

    3.6310

    polar.app.g8.8xlarge
    64核512 GB

    2,964.21

    5.9407

    polar.app.g8.12xlarge
    88核710 GB

    4,075.79

    8.1664

    polar.app.g8.15xlarge
    120核920 GB

    5,557.89

    11.1389

    polar.app.g8.23xlarge
    180核1800 GB

    8,336.84

    16.7062

    美国(硅谷)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    45.11

    0.0903

    polar.app.g4.medium
    2核8 GB

    48.72

    0.0973

    polar.app.g2.large
    4核8 GB

    85.71

    0.1719

    polar.app.g4.large
    4核16 GB

    113.68

    0.2275

    polar.app.g2.xlarge
    8核16 GB

    180.45

    0.3618

    polar.app.g4.xlarge
    8核32 GB

    223.76

    0.4486

    polar.app.g2.2xlarge
    16核32 GB

    360.90

    0.7236

    polar.app.g4.2xlarge
    16核64 GB

    433.08

    0.8683

    polar.app.g2.4xlarge
    32核64 GB

    721.80

    1.4443

    polar.app.g4.4xlarge
    32核128 GB

    779.55

    1.5557

    polar.app.g4.6xlarge
    48核192 GB

    1,082.71

    2.1679

    polar.app.g8.6xlarge
    48核384 GB

    1,169.32

    2.3343

    polar.app.g2.8xlarge
    64核128 GB

    1,443.61

    2.8900

    polar.app.g4.8xlarge
    64核256 GB

    1,559.10

    3.1114

    polar.app.g8.8xlarge
    64核512 GB

    2,540.75

    5.0912

    polar.app.g8.12xlarge
    88核710 GB

    3,493.53

    7.0000

    polar.app.g8.15xlarge
    120核920 GB

    4,763.91

    9.5485

    polar.app.g8.23xlarge
    180核1800 GB

    7,145.86

    14.3198

    美国(弗吉尼亚)

    节点规格码

    CPU和内存

    价格(美元/月)

    价格(美元/小时)

    polar.app.g2.medium
    2核4 GB

    45.11

    0.0903

    polar.app.g4.medium
    2核8 GB

    48.72

    0.0973

    polar.app.g2.large
    4核8 GB

    85.71

    0.1719

    polar.app.g4.large
    4核16 GB

    113.68

    0.2275

    polar.app.g2.xlarge
    8核16 GB

    180.45

    0.3618

    polar.app.g4.xlarge
    8核32 GB

    223.76

    0.4486

    polar.app.g2.2xlarge
    16核32 GB

    360.90

    0.7236

    polar.app.g4.2xlarge
    16核64 GB

    433.08

    0.8683

    polar.app.g2.4xlarge
    32核64 GB

    721.80

    1.4443

    polar.app.g4.4xlarge
    32核128 GB

    779.55

    1.5557

    polar.app.g4.6xlarge
    48核192 GB

    1,082.71

    2.1679

    polar.app.g8.6xlarge
    48核384 GB

    1,169.32

    2.3343

    polar.app.g2.8xlarge
    64核128 GB

    1,443.61

    2.8900

    polar.app.g4.8xlarge
    64核256 GB

    1,559.10

    3.1114

    polar.app.g8.8xlarge
    64核512 GB

    2,540.75

    5.0912

    polar.app.g8.12xlarge
    88核710 GB

    3,493.53

    7.0000

    polar.app.g8.15xlarge
    120核920 GB

    4,763.91

    9.5485

    polar.app.g8.23xlarge
    180核1800 GB

    7,145.86

    14.3198

  • 存储费用:Ray应用所产生的数据和文件不额外计费,但Ray Job向PolarDB MySQL版集群或PolarDB文件系统存储写入的数据将收取相应的存储空间费用。

  • 流量与带宽:不收取费用。

开始使用

  1. 创建Ray应用:使用已有集群或新购集群快速创建Ray应用(即PolarDB Ray)。

  2. Ray应用配置:设置Ray应用安全配置、获取连接地址与应用参数以及(可选)开通公网访问能力。

  3. Ray Notebook使用指南:如何访问Ray应用内置的Ray Notebook,并运行一个简单的分布式应用。

  4. 提交作业到Ray应用:如何通过多种方式(包括JupyterLab、Python SDK、CLI等)将一个Ray作业提交到您的Ray应用并执行。