From Sharding-JDBC to Sharding-Sphere, A New Travel Begins

Apache ShardingSphere
4 min readMay 16, 2018

Through over two years of growth and development, Sharding-JDBC gained the 4,000th star on github recently, which has now occupied a place in the field of distributed database middleware. Sharding-JDBC has always been positioned as a lightweight Java framework that provides additional services in Java’s JDBC layer. It uses client to connect database directly and provides services in the form of jar without additional deployment and dependencies. It can be understood as an enhanced version of JDBC driver, which is fully compatible with JDBC and various ORM frameworks.

However, it is difficult to deal with more diverse scenarios only through embedding JDBC layer, such as heterogeneous languages other than Java, command line tools of database manager, UI and so on. It is easier to support corresponding application scenario by simulating the middle layer of database based on Proxy.

Proxy solution and JDBC-based Client solution, which one is better? This is a classic topic that have long been debated. In fact, both of them have advantages and disadvantages. What architects should focus on in the process of technology selection is to maximize their advantage in a suitable scenario and shield the disadvantages. A simple comparison of the two solutions is as follows:

In order to deal with scenarios with heterogeneous languages, we have developed a Proxy version based on MySQL, and the original JDBC version is also preserved, providing more choices for users in diverse scenarios.

Due to the development of the Proxy version, Sharding-JDBC is no longer suitable as the name of this project, but we cannot afford to abandon the influence of Sharding-JDBC accumulated over the past two years. Therefore, we have retained the keyword “Sharding”. Moreover, for distributed database middleware, “Sharding” is the source of no matter flexible transactions or data orchestration. We have formed an ecosystem with the original Sharding-JDBC, the newly developed Sharding-Proxy and Sharding-Sidecar being incubated now, and named it Sharding-Sphere. In the picture below, the blue parts refer to functions which have been implemented, and the orange parts are functions to be developed.

To choose Proxy or Client, it is always a hot topic, but it can be slightly relieved in Sharding-Sphere. No matter which architecture pattern is chosen, Sharding-Sphere will use the same set of cores to handle SQL parsing, routing, rewriting, result merging and other core features, so that users do not need to worry about the incompatibility of functions from two different products. It is also very simple to use either two or three parts of Sharding-Sphere in the same system. For example, for the scenario where only Java is used as the technology stack, Sharding-JDBC supports a variety of ORM frameworks of Java, so that developers can easily introduce data sharding capability into existing systems and deploy it to the online environment. Also, DBA can query and manage data by deploying a Sharding-Proxy instance.

Sharding-Sphere is operated in a completely community way. The name-changing is determined by community voting. See: https://github.com/sharding-sphere/sharding-sphere/issues/788

The vote lasted for one week with a result of 39 affirmative votes and 1 abstention vote, in which all the 13 PMC members and official contributors gave affirmative votes. The public voting has ended now.

Sharding-Sphere will release 3.0.0.M1 version soon. Wish you can give you comment.

Sharding-Sphere, consisting of three independent products, namely Sharding-JDBC, Sharding-Proxy, and Sharding-Sidecar, is an ecosystem of open source distributed database middleware solutions. They all provide standardized data sharding, read-write splitting, flexible transactions and data management functions, which can be applied to various application scenarios such as Java isomorphic and heterogeneous languages, containers and cloud natives.

For more information, you could visit our new website:

http://shardingsphere.io/

or Twitter: @ShardingSphere

If you like it, please give us a star on Github as encouragement.

The project address:

https://github.com/sharding-sphere/sharding-sphere/

https://gitee.com/sharding-sphere/sharding-sphere/

Thank you very much.

--

--

Apache ShardingSphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database. https://linktr.ee/ApacheShardingSphere