• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2023, Vol. 45 ›› Issue (12): 2165-2174.

• 软件工程 • 上一篇    下一篇

ShadowDB:基于SQL引擎的全链路压力测试分流系统

姜俊1,李文慧1,张亮2,王善民2,李瑞远1   

  1. (1.重庆大学计算机学院,重庆 400044;2.思斐实验室,北京 100010)
  • 收稿日期:2022-12-08 修回日期:2023-04-15 接受日期:2023-12-25 出版日期:2023-12-25 发布日期:2023-12-14
  • 基金资助:
    国家自然科学基金(62202070);中国博士后科学基金(2022M720567)

ShadowDB: A SQL engine based traffic-split system for full-link stress test

JIANG Jun1,LI Wen-hui1,ZAHNG Liang2,WANG Shan-min2,LI Rui-yuan1   

  1. (1.College of Computer Science,Chongqing University,Chongqing 400044; 2.SphereEx Laboratory,Beijing 100010,China)
  • Received:2022-12-08 Revised:2023-04-15 Accepted:2023-12-25 Online:2023-12-25 Published:2023-12-14

摘要: 全链路压力测试作为一种新兴的软件测试技术,直接在生产系统中做压力测试,旨在准确评估线上环境的性能。基于影子库的数据分流技术能够保证全链路压力测试过程中生产数据不受测试污染。基于SQL引擎技术设计并实现了一套完整的针对全链路压力测试的开源数据分流系统ShadowDB,其基本思想是通过SQL解析、SQL路由对用户请求正确分流。ShadowDB目前支持6种关系型数据库系统中所有SQL语句的数据分流;提出了2种数据分流算法:基于列的影子算法和基于Hint的影子算法;实现了所有JDBC的接口,允许线上应用程序无需修改代码即可使用ShadowDB;ShadowDB嵌入应用程序中,无需网络转发请求,对请求效率影响很小,保证了全链路压力测试结果的可靠性。使用2个通用的性能测试工具进行了大量的实验,结果表明ShadowDB的性能远远高于对比方案的。

关键词: 全链路压力测试, SQL引擎, 数据分流, 影子库

Abstract: Full-link stress test, as an emerging software testing technique, performs stress tests in the production system directly. It aims at evaluating the performance of online systems accurately. Traffic-split techniques based on shadow databases can guarantee the production data not to be polluted during the process of full-link stress test. Based on SQL engine, this paper designs and implements a complete open-source traffic-split system, named ShadowDB, for full-link stress test. The main idea of ShadowDB is to split the traffic of user requests through a SQL parser and a SQL router. Currently, ShadowDB can correctly distribute all SQL statements of six different kinds of relational database management systems. Furthermore, it can support two traffic-split algorithms, i.e., column-based shadow algorithm and hint-based shadow algorithm. ShadowDB implements all of the interfaces of JDBC, enabling online systems to incorporate it without any change. ShadowDB can be embedded in the application programs, thus it do not forward the requests through networks, which has the minimal impact on the request efficiency and guarantees the reliability of full-link stress test. Extensive experiments wire conducted based on two widely-used benchmarking tools. The experimental results show that ShadowDB performs much better than the comparing systems.


Key words: full-link stress test, SQL engine, traffic split, shadow database ,