Repository navigation
RIP 30 Support Compaction topic
- Current Status: Draft
- Authors: ltamber https://github.com/ltamber
- Shepherds: duhengforever duhengforever@apache.org
- Mailing List discussion: dev@rocketmq.apache.org
- Pull Request: #PR_NUMBER
- Released: <released_version>
- will we add a new module? no.
- will we add new APIs? no.
- will we add a new feature? yes.
- Are there any problems of our current project?
Currently, Apache RocketMQ does not support the compaction topic, which results in that if the application(such as connector/streams[1] https://lists.apache.org/thread/c85oj18whdjnxc331n1fxqhb8z50bpnm) uses messages to store state and only need the latest state data at a certain time, it needs to pull all the messages from the broker, this process will consume a lot of time; At the same time, a lot of data is not required by the client. Therefore, we need a special data cleaning mechanism, which is to compress the same type of data (same key), and only keep the latest data, In this way, only a small amount of data is loaded when the application starts.
Chinese version: RocketMQ çŽĺčżä¸ćŻćcompation topicďźčżĺŻźč´ĺşç¨ĺŚć使ç¨ćśćŻćĽĺĺ¨çśćĺšśä¸ĺ¨ćä¸ćśĺťäť éčŚćć°ççśćć°ćŽćś(äžĺŚconnector/streams) éčŚäťćĺĄçŤŻćĺććçćśćŻďźčżä¸Şčżç¨äźćśč大éćśé´ďźĺćśĺžĺ¤ć°ćŽäšä¸ćŻĺŽ˘ćˇçŤŻéčŚçďźĺ ć¤ďźć䝏éčŚä¸ä¸ŞçšćŽçć°ćŽć¸ çćşĺśďźĺ°ąćŻĺ°ç¸ĺçąťĺçć°ćŽ(ç¸ĺçkey)čżčĄĺ矊ďźäť äżçćć°çć°ćŽďźäťĽć¤ćĽčžžĺ°ĺşç¨ĺŻĺ¨ćśäť ĺ č˝˝ĺ°éć°ćŽçčŻćąă
- What can we benefit proposed changes?
Improve the business scenarios that rocketmq can support
Chinese version: ĺŽĺrocketmqč˝ćŻćçä¸ĺĄĺşćŻ
Support compress topic data on the server-side.
Chinese version: ćŻććĺĄçŤŻĺŻštopicć°ćŽčżčĄĺ矊
- To what degree should we solve the problem?
Supports compression of topic data by time dimension and message size dimension
Chinese version: ćŻćććśé´çť´ĺşŚăćśćŻĺ¤§ĺ°çť´ĺşŚĺŻštopicć°ćŽčżčĄĺ矊
- What problem is this proposal NOT designed to solve? Nothing specific.
- Are there any limits of this proposal? Nothing specific.
The data is first written to the commitlog like ordinary messages, and then asynchronously written to the separate compaction log file by the report service.
Chinese version: ć°ćŽä¸ćŽéćśćŻä¸ć ˇĺ ĺĺ Ľcommitlogďźçśĺçąreput serviceĺźćĽĺĺĺ Ľĺ°ĺçŹçcompactionćĽĺżćäťś
-
Compaction
-
determine the compaction position
-
Traverse data to generate <key, offset> Map
-
Traverse the data according to the <key, offset> Map and keep only the latest data for the same key
-
-
Chinese version:
-
ĺ 祎ĺŽcompactionçťćä˝ç˝Ž
-
éĺć°ćŽçć<key, offset> Map
-
ć šćŽ<key, offset> Mapĺéĺć°ćŽĺ°ç¸ĺkeyçć°ćŽäť äżçćć°ç
-
-
Index
refer to
https://github.com/apache/rocketmq/wiki/RIP-26-Improve-Batch-Message-Processing-Throughput Interface Design/Change
-
Method signature changes. No
-
Method behavior changes. No
-
CLI command changes. No
-
Log format or content changes. No
- Are backward and forward compatibility taken into consideration?
Nothing specific.
- Are there deprecated APIs? Nothing specific.
- How do we do migration? Nothing specific.
Copyright Š 2016~2022 The Apache Software Foundation.
- Home
- RocketMQ Improvement Proposal
- User Guide
- Community