Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 能否替换tidb的存储?
Is there anyone knowledgeable? In a single-node scenario, the TiDB server has the capability to parse, optimize, and generate execution plans. So, can the storage use a self-developed KV storage instead of TiKV and connect with the TiDB server? Is there any official documentation guiding this integration?
It doesn’t seem like that’s the way to do it, that’s a big move.
tidb-server mainly handles SQL parsing and compilation? Do you need to implement this functionality yourself? TiDB has a Go SQL parser.
What is the purpose of the replacement?
Are you planning to wrap a new database yourself?
Are you planning to develop a database independently? TiKV is a core component.
Won’t it increase costs and risks?
The official TiDB team also thinks that building a database engine is difficult, so they use RocksDB at the lower level. What do you plan to use at the lower level?
This involves the underlying functionality, so it is definitely possible. The key is to find the development documentation for this database or to study the source code yourself (difficult).
The source code of the TiDB server itself mocks a storage engine. I guess it should be possible to connect to other storage engines, but it’s super complicated. I haven’t seen any documentation on this, so I can only rely on reading the code.
If your skills are strong enough, you can definitely do it. If your skills are lacking, you might as well just give up.
RocksDB, as the core storage engine of TiKV, is deeply integrated with TiDB, and many parameter settings are associated with it. Replacing the TiKV engine is as challenging and labor-intensive as rewriting TiDB.
Then why not do it in MySQL? Under the MySQL Server layer, you can connect to storage engines like InnoDB and others.
Not recommended to replace.
How much R&D investment is required?
This involves the underlying layer. If you are strong enough, you can give it a try~!
I haven’t seen any official documentation, unless you look for the corresponding interfaces in the code yourself.