Shall we change badger and unistore as an interface plugin

I hope we can change badger and unistore as an interface plugin. It means that only TiDB test will depend on badger and unistore. TiDB library and binary will not depend on them so that if there is any repo depend on TiDB, it would never be effected by unistore and badger.

1 Like

… also dependency on badger pollute other dependencies and cause issues like

TiDB doesn’t depend on unistore repo in the master branch, for the forked pingcap/badger repo, it’s only used by tidb. We can modify it anyway we want.

The backup feature in badger is not needed, we can simply remove it.

It seems that if some repo depend on tidb/br, it will compile the whole tidb repo…

Seems we need to clean the dependency of tidb/br

There are two ideas from my side,

  1. Remove backup feature from pingcap/badger as we don’t need it.
  2. Investigate go submodule to see whether we can improve modularity.

cc @Little-Wallace @coocood @disksing what do you think?

It looks like there are two problems here:

  • a) projects that depend on tidb will also depend on br
  • b) projects that depend on br will also depend on tidb

Creating a separate go.mod for br will solve problem b, but only if the mutual dependencies between br and tidb are resolved first.

For problem a, the non-test version of tidb actually needs to use unistore as well (standalone mode without using tikv). We also need to disassemble the tidb mod further. This could be done by separating tidb as a library from the tidb-server as an app and making only the tidb-server import unistore.