Practical Experience of MyRocks in NetEase Media Business
Since 2019 NetEase Media has migrated several recommendation and account services from RDS to MyRocks, cutting disk usage by up to 68 % and halving response times while handling 40‑50 k QPS write‑heavy workloads, though the engine lacks partitioning, online DDL, and certain index types, requiring careful workload assessment.
In 2019 the team began migrating the media‑backend recommendation services from RDS to MyRocks to overcome storage bottlenecks and fragmentation caused by massive insert‑update workloads. The migration started with a physical MySQL cluster, but MyRocks was chosen for its LSM‑Tree based storage engine, which turns random writes into sequential writes.
MyRocks is a RocksDB‑based storage engine ported to MySQL. It supports most MySQL features (SQL read/write, MVCC, transactions, replication) while using a Log‑Structured‑Merge‑Tree (LSM‑Tree) that writes data first to a WAL, then to an in‑memory MemTable (active), which is frozen to an immutable MemTable and eventually flushed to SST files.
Applicable Scenarios
Write‑intensive workloads: batch inserts and frequent updates benefit from the sequential‑write nature of MyRocks, delivering up to double the performance of InnoDB in Alibaba Cloud benchmarks.
Large‑scale data: RocksDB’s LSM‑Tree provides higher compression, reducing storage usage compared with InnoDB.
Practical Deployments in NetEase Media
Content Processing : Migrated ~2 TB of long‑text tables from RDS to MyRocks, achieving a 60 % reduction in disk usage (≈6 TB SSD saved) and lowering average response time from 0.96 ms to 0.53 ms.
NetEase Account : After moving to MyRocks, disk usage dropped 68 % (≈3.5 TB saved) and average RT improved from 2.29 ms to 2.10 ms. Daily batch jobs were cut from 100 min to 45 min.
NetEase Video : Historical data archived to MyRocks reduced the RDS disk footprint by 60 % (≈1 TB saved).
News Feed Recommendation : Combined DDB with MyRocks to handle high QPS (40‑50 k) write‑heavy workloads, achieving sub‑millisecond RT and significant storage savings.
Performance Limitations
MyRocks does not support partitioned tables, online DDL, foreign keys, full‑text or spatial indexes, and has limited gap‑lock and savepoint support. Range queries can be slower than InnoDB; for example, the following query took 2.004 s before optimization:
SELECT docid, doctype, modifyTime FROM table WHERE modifyTime<? AND modifyTime>? LIMIT 100;After adding an ORDER BY clause to force index usage, the same query completed in 0.051 s:
SELECT docid, doctype, modifyTime FROM table WHERE modifyTime<? AND modifyTime>? ORDER BY modifyTime DESC LIMIT 100;Other constraints include case‑sensitivity, lack of MRR, no O_DIRECT, and instability when mixing InnoDB with RocksDB.
Summary
Compared with InnoDB, MyRocks reduces storage consumption, offers lower write amplification, converts random writes to sequential writes, extends SSD lifespan, and can lower replication lag through tuning. It is well‑suited for large‑scale, write‑intensive scenarios and can serve as a persistent alternative to Redis. However, its limitations (e.g., lack of partitioning, certain index types) require careful evaluation of workload characteristics before adoption.
NetEase Media Technology Team
NetEase Media Technology Team
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.