Orca (Redis-Compatible)

Updated at:

Orca is a persistent key-value database developed based on PolarDB for MySQL and compatible with the Redis protocol. After you enable the Orca feature, the PolarDB for MySQL cluster can meet the requirements of MySQL scenarios and also provide NoSQL (Redis protocol) capabilities. Your business can then process relational data and Redis-style data structures on a unified data foundation. Applications can continue to use familiar Redis clients and access methods. This reduces the operations complexity and overall cost of separate middleware while providing lower latency for Redis protocol access. Orca also supports individual values of up to 4 GB, which makes it better suited to very large object data scenarios.

Note

If you have questions about the Orca feature, search for the group number in DingTalk to join the group. You can directly @ the experts in the group and include your question.

DingTalk group number: 126410000799

How it works

Traditional key-value databases, such as the open-source Pika and Kvrocks projects, are usually designed for high scalability. However, actual deployments can still introduce complexities such as node coordination and operations management. To address these issues, PolarDB for MySQL introduced the Orca feature. After you purchase a PolarDB for MySQL cluster, that cluster can also serve as a persistent key-value database compatible with the Redis protocol. MySQL data and key-value data compatible with the Redis protocol are isolated from each other.

Based on the PolarDB for MySQL architecture, Orca introduces a framework for parsing and processing Redis protocol requests. All requests related to Orca (Redis protocol) connect to a separate port. The following figure shows the technical architecture of PolarDB for MySQL Orca:6A3DA64C-27CA-4721-B308-5C3B32C9B849

Key advantages

  • Low cost

    • Avoids duplicate purchases of compute node resources and meets large-capacity requirements through high-performance distributed storage.

  • Ease of use

    • Based on the PolarDB for MySQL architecture, Orca uses physical replication to support one write and multiple reads. Orca also supports horizontal and vertical Serverless elastic scaling and provides compute hot standby, which effectively reduces operations overhead.

    • Orca is compatible with new PolarDB for MySQL product forms, including Global Database Network (GDN). With GDN + Orca, you can deploy applications across multiple regions. GDN provides cross-region low-latency synchronization, cross-region read/write splitting, and nearby reads, which ensures that applications in each region access Orca with latency of less than 2 seconds.

  • Data persistence and strong consistency

    • Implemented with the InnoDB storage engine of PolarDB for MySQL, Orca uses distributed storage PolarStore to ensure that data is not lost.

    • Based on PolarDB for MySQL's SCC technology, Orca delivers strong read consistency for RW/RO nodes.

  • High performance

    • Based on the high-performance InnoDB engine, Blink-tree high-performance index structures, and logical prefetch, Orca significantly improves performance in high-concurrency write and read scenarios.

    • Based on the Elastic Memory Pool of distributed storage PolarStore, Orca significantly improves read performance in IO-Bound scenarios.

Common scenarios

Orca is designed to provide Redis protocol compatibility based on PolarDB for MySQL, and it complements Redis use cases. You can regard Orca as a persistent key-value database. By using the very large storage capacity of distributed storage PolarStore (up to 500 TB), Orca effectively resolves cost and data-capacity limitations while retaining the ease of use of Redis.

  • Core database for game servers: Game deployment architectures are relatively simple. The main application is deployed on ECS, and all business data is stored in Orca. As a persistent database, Orca provides dual-AZ disaster recovery by default, fast backups, point-in-time recovery, high-performance writes, and read-only node scaling to meet the write-capacity scaling requirements of games.

  • Game leaderboards: In gaming applications, real-time leaderboard updates and fast access to player status are essential. Orca can store player scores and rankings, and it uses the Sorted set data structure of the Redis protocol to implement leaderboards.

  • Ad recommendation services: In many internet advertising scenarios, advertising systems must store large amounts of data and process high-concurrency requests. Orca provides stable low latency and low storage costs, which effectively meets the delivery requirements of advertising businesses.

  • Lua script execution engine: In production, clients often need to combine multiple Redis commands into an atomic operation to ensure data consistency, for example, in inventory deduction, distributed lock, and rate limiting scenarios. Orca is compatible with the Redis protocol EVAL/EVALSHA commands and supports server-side Lua script execution, which encapsulates multiple operations into an atomic transaction. This reduces network round-trip overhead and ensures the atomicity of operations. After you enable the Orca feature, you can run Lua scripts without additional middleware.

  • Lightweight message queue: In some scenarios, applications need a reliable message queue for asynchronous task processing, event notifications, or service decoupling. Orca is compatible with the List data structure of the Redis protocol and naturally supports the producer-consumer model of message queues through commands such as LPUSH/BRPOP. You only need to purchase a PolarDB for MySQL cluster and enable the Orca feature to meet lightweight message queue requirements. You do not need to deploy and maintain separate message middleware, which effectively reduces architecture complexity and operations costs. In addition, PolarDB for MySQL's data persistence and high availability ensure the security of message data.

  • Redis protocol capabilities on a unified data stack: If you want to use PolarDB for MySQL as a unified data foundation but also need Redis protocol-like data structure capabilities, Orca can provide Redis-compatible data structure services on top of the existing PolarDB for MySQL system. You can manage relational data and also process data structures such as hashes, sets, queues, and leaderboards, while gaining unified data management and data persistence.

  • Storage for very large value objects: In scenarios such as user profiles, recommendation features, document results, and AI task states, the value of a single key can be very large. Based on PolarDB for MySQL's BLOB performance optimization, Orca supports individual values of up to 4 GB and can directly handle persistent storage for very large objects. Your business can keep using a simple key-value access model while reducing the complexity of splitting, moving, and managing large objects.

  • Local development and integration testing: In local development, joint testing, and CI scenarios, applications typically require the same Redis protocol interface as production without the need to deploy and maintain a separate Redis service. Orca is compatible with the Redis protocol and can serve as persistent key-value storage for feature validation, issue reproduction, and regression testing. This reduces environment complexity and improves development efficiency.

Requirements

Your PolarDB for MySQL cluster must meet the following requirements:

  • CPU architecture: x86

  • Engine version:

    • MySQL 8.0.1, and the minor engine version must be 8.0.1.1.53 or later.

    • MySQL 8.0.2, and the minor engine version must be 8.0.2.2.24 or later.

Billing

The Orca feature is free to use. It does not incur additional compute node charges, and only the storage fees for Orca data are charged. For pricing information, see Compute node billing rules and Storage space billing rules.

Usage notes

  • The Orca feature does not support password-free access. You must Create an Orca account.

  • After you enable the Orca feature, Orca reuses the CPU and memory resources of the entire PolarDB for MySQL cluster, so Orca workloads increase the load on the entire cluster. The actual additional CPU and memory overhead depends on your workload.

  • After you enable the Orca feature, the PolarDB for MySQL cluster automatically creates a default Orca database named __orca_in_polardb_m_. You cannot perform any operations on this database, and you cannot create another database with the same name.

Compatibility

Orca is compatible with some commands in Redis 7.0 and earlier versions, and it supports the RESP2/RESP3 protocol. Orca supports up to 16 Redis DBs (DB 0 to DB 15) but does not yet support cross-DB commands such as MOVE. For details, see Redis protocol compatibility.

Usage

  1. Enable Orca:

    • Enable Orca on the cluster purchase page.

    • On the cluster details page, enable Orca in the Basic Information > Configurations area.

  2. Create an Orca account: On the cluster details page, create an Orca account in the Settings and Management > Accounts area. For more information, see Create an Orca account.

  3. Manage Orca endpoints and ports: On the cluster details page, view the Orca endpoint and port in the Basic Information > Database Connections area. For more information, see Manage Orca endpoints.

  4. Connect to Orca (Redis protocol): You can use a Redis client or application to connect to and use Orca.

    Note

    You can use Data Management Service (DMS) to connect to and manage the Orca feature.

  5. View Orca monitoring metrics: On the cluster details page, view Orca monitoring metrics in the Performance Monitoring area based on your business needs. For more information, see Orca monitoring metrics.

  6. (Optional) Data migration: Use Data Transmission Service (DTS) to implement Migrate Orca data with DTS.