Skip to content

isHuangXin/GSoC-2022-DistSQL-Convert-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation


gsoc banner

GSoC 2022 - Final Project Report

The following report summarizes my work done during Google Summer of Code 2022 with the Apache Software Foundation.

Contributor Details

About the Project

ShardingSphere logo

The ecosystem to transform any database into a distributed database system.


Apache ShardingSphere is positioned as a Database Plus, and aims at building a standard layer and ecosystem above heterogeneous databases. It focuses on how to reuse existing databases and their respective upper layer, rather than creating a new database. The goal is to minimize or eliminate the challenges caused by underlying databases fragmentation.

Since version 5.0.0, shardingSphere provides its own management language: DistSQL, which greatly facilitates users to manage distributed databases. There are now many users who want to convert from legacy YAML configuration to DistSQL, and we want to design and implement a command line tool that allows the user to enter a path to a YAML configuration file and output a DistSQL script.

More details:

https://shardingsphere.apache.org/document/current/en/reference/distsql/syntax/rdl/resource-definition/add-resource/

Goals

Develop an external tool to convert YAML configuration into DistSQL scripts. I have built a prototype for this proposal: DistSQL RDL, e.g.ADD and CREATE.It has the function of reading YAML files, parsing the content, and then using DistSQL RDL commands to output DistSQL scripts.

ShardingSphere logo

A pototype of converting Yaml file to DistSQL script.


All the DistSQL convert functions and test cases I need to finish.

ADD RESOURCE DATASOURCE TEST CASE
CREATE SHARDING TABLE RULE TEST CASE
CREATE SHARDING BINDING TABLE RULE TEST CASE
CREATE SHARDING BROADCAST TABLE RULE TEST CASE
CREATE SHARDING ALGORITHM TEST CASE
CREATE SHARDING STRATEGY TEST CASE
CREATE SHARDING KEY GENERATOR TEST CASE
CREATE READWRITE_SPLITTING RULE TEST CASE
CREATE DB_DISCOVERY RULE TEST CASE
CREATE ENCRYPT RULE TEST CASE
CREATE SHADOW RULE TEST CASE

Approach and Workflow

workflow

DistSQL Convert Process


Pull Requests and Issues

Community Bonding period

Includes Community Issues and PRs.

  • #16915: Issues: Apply for this project in Discussions

Coding Period

Includes PRs and Issues related to GSoC project

  • #17939: [ GSoC 2022 ] Develop an external tool to convert YAML configuration into DistSQL scripts
  • #19280: Support ADD RESOURCE DATASOURCE DistSQL Convert
  • #19509: Support CREATE SHARDING TABLE RULE DistSQL Convert
  • #19509: Support CREATE SHARDING BINDING TABLE RULE DistSQL Convert
  • #20843: Support CREATE SHARDING BROADCAST TABLE RULE DistSQL Convert
  • #19509: Support CREATE SHARDING ALGORITHM DistSQL Convert
  • #19509: Support CREATE SHARDING STRATEGY DistSQL Convert
  • #19509: Support CREATE SHARDING KEY GENERATOR DistSQL Convert
  • #20648: Support CREATE READWRITE_SPLITTING RULE DistSQL Convert
  • #20707: Support CREATE DB_DISCOVERY RULE DistSQL Convert
  • #20748: Support CREATE ENCRYPT RULE DistSQL Convert
  • #20843: Support CREATE SHADOW RULE DistSQL Convert

Result

Intended Goals were met during the standard coding period, DistSQL Convert for the Yaml files were achieved.

  • Example: the yaml file needs to be converted
workflow

Yaml File


  • Example: the converted DistSQL script
workflow

Converted DistSQL


Future Scope

Now that the project of Developing an external tool to convert YAML configuration into DistSQL scripts is completed. Next, I will focus on refactoring the ConvertYamlConfiguration.java to achieve the mixed configuration of DistSQL.

Acknowledgement

The past 3 months have challenged me to learn and grow. I had a fruitful summer coding and interacting with the Apache ShardingSphere community. This experience made me interested in open source projects, and I will continue contributing solutions and code to the shardingsphere via participating in WeOpen-Star 2022 (by Tencent).

And finally, I also would like to show my gratitude to my mentor Raigor Jiang for guiding me throughout this journey and Google for organizing such a beneficial program.

Additional Links

About

GSoC 2022 - Final Project Report

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published