What middleware do you use for sub-database and sub-table, and what are the advantages and disadvantages?

Analysis & Answer

According to my actual use:

cobar

Developed and open sourced by the Ali b2b team, it belongs to the proxy layer solution. It was still usable in the early years, but it hasn’t been updated in recent years, and basically no one uses it. It’s almost abandoned. Moreover, operations such as read-write separation, stored procedures, cross-library join, and paging are not supported.

mycat

Based on the cobar transformation, it belongs to the proxy layer solution , and the supported functions are very complete, and it should be a very popular and popular database middleware at present, and the community is very active. The disadvantage of this proxy layer solution is that it needs to be deployed , and a set of middleware needs to be operated and maintained by itself. The operation and maintenance cost is high, but the advantage is that it is transparent to each project. If you encounter upgrades and the like, you can do it with your own middleware. .

sharding-jdbc

Dangdang is open source and belongs to the client layer solution . It is true that I used it more before, because there are many SQL syntax supports without too many restrictions, and it is currently released to version 2.0, which supports sub-database and table, read-write separation, distributed id generation, flexible transactions (best effort sent up-to-type transaction, TCC transaction). The advantage of this client layer solution is that it does not need to be deployed , the operation and maintenance cost is low, and it does not need the secondary forwarding request of the proxy layer. It is necessary to couple the dependencies of sharding-jdbc;

Meow Interview Assistant: One-stop solution to interview questions, you can search the WeChat applet [Meow Interview Assistant]  or follow [Meow Brush Questions] -> Interview Assistant  free questions. If you have good interview knowledge or skills, look forward to your sharing!

Guess you like

Origin blog.csdn.net/jjclove/article/details/127391832