Computer Science ›› 2021, Vol. 48 ›› Issue (11): 54-61.doi: 10.11896/jsjkx.210100220

• Blockchain Technology • Previous Articles     Next Articles

SQL Access Framework for Hyperledger Fabric

YU Zhi-yong, LIN Li-qiang, CHEN Yan, ZHOU Tian, NI Yi-tao, CHEN Xing   

  1. College of Mathematics and Computer Science,Fuzhou University,Fuzhou 350108,China
    Fujian Key Laboratory of Network Computing and Intelligent Information Processing (Fuzhou University),Fuzhou 350108,China
  • Received:2021-01-28 Revised:2021-05-31 Online:2021-11-15 Published:2021-11-10
  • About author:YU Zhi-yong,born in 1982,Ph.D,is a member of China Computer Federation.His main research interests include pervasive computing,socially-aware-computing,and CSCW.
    NI Yi-tao,born in 1969,Ph.D,is a member of China Computer Federation.His main research interests include software engineering,system security,etc.
  • Supported by:
    National Key R & D Program of China(2018YFB1004800),Natural Science Foundation of Fujian Province for Distinguished Young Scholars(2020J06014) and Natural Science Foundation of Fujian Province(2018J07005).

Abstract: Blockchain technology has the advantages of decentralization,non-tampering,and traceability,and has been widely used in various fields.However,as a cutting-edge technology,blockchain has problems in development and high learning costs,and most developers are more familiar with application development methods based on relational databases,that is operating relational databases through SQL.Hyperledger Fabric is the most mainstream blockchain development framework.In response to this pro-blem,the article proposes a SQL access framework for Hyperledger Fabric.First of all,in view of the inconsistency of the underlying storage structure of Fabric and SQL,the conversion rules from relational model to key-value model are defined and implemented the model conversion algorithm.Second,the SQL execution contract is developed based on smart contract technology,which realizes the automatic transformation from SQL statement to CouchDB operation statement,and then operates the under-lying data of Fabric.Finally,from the perspective of application layer development,an application automation refactoring tool is designed.The tool consists of two parts,including the application refactoring tool and the blockchain.Fabric-Driver is an interactive middleware for the network.The experimental results show that compared with the existing scheme,using the proposed framework to develop blockchain applications can save about 82% of the time,the reading and writing performance of using this framework is less than 5%.

Key words: Blockchain, Hyperledger Fabric, Key-value model, Model transformation, Smart contract

CLC Number: 

  • TP311
[1]EF Codd:A Relational Model of Data for Large Shared Databa-ses[J].Information Processing,2003,44(10):1090.
[2]HELLERSTEIN J M,STONEBRAKER M.Architecture of aDatabase System[J].Foundations & Trends in Databases,2007,1(2):141-259.
[3]ANDROULAKI E,BARGER A,BORTNIKOV V,et al.Hy-perledger fabric:a distributed operating system for permissioned blockchains[C]//Proceedings of the Thirteenth EuroSys Conference.2018:1-15.
[4]CACHIN C.Architecture of the hyperledger blockchain fabric[C]//Workshop on Distributed Crypto Cxirrencies and Consensus Ledgers.2016.
[5]GRIGONK I.SSTable and log structured storage:LevelDB[EB/OL].https://www.igvita.com/2012/02/06/sstable-and-log-structured-storage-leveldb/.
[6]LIM H,FAN B,ANDERSEN D G,et al.SILT:A Memory-Efficient,High-Performance Key-Value Store[C]//ACM Sympo-sium on Operating Systems Principles.2011:1-13.
[7]RAHIM S R M,MOHAMAD Z Z,BAKAR J A,et al.Artificial Intelligence,Smart Contract and Islamic Finance[J].Asian Social Ence.,2018,14(2):145.
[8] PARK K,PENG L.A Design of High-speed Big Data QueryProcessing System for Social Data Analysis:Using Spark SQL[J].International Journal of Applied Engineering Research,2016,11(14 Pt.2):8221-8225.
[9]WHITE T.Hadoop:The Definitive Guide[J].O'rlly Media Inc Gravenstn Highway North,2012,215(11):1-4.
[10]WANG Q G,HE P,NIE T Z,et al.Data storage and query technology of blockchain system[J].Computer Science,2018,45(12):19-25.
[11]YUAN Y,WANG F Y.Development status and prospect of
blockchain technology[J].Journal of Automation,2016,42(4):481-494.
[12]HE P,YU G,ZHANG Y F,et al.Overview of blockchain technology and application[J].Computer Science,2017,44(4):1-7.
[13]Al A E.CouchDB Definitive Guide[J].Andre,2010,215(1):76-80.
[14]ANDERSON J C,LEHNARDT J,SLATER N.CouchDB:The Definitive Guide:Time to Relax[M]//CouchDB:The Definitive Guide Time to Relax.O'Reilly Media,Inc.,2010.
[15]TSCHORSCH F,SCHEUERMANN B.Bitcoin and Beyond:ATechnical Survey on Decentralized Digital Currencies[J].IEEE Communications Surveys & Tutorials,2016,18(3):2084-2123.
[16]BÖHME R,CHRISTIN N,EDELMAN B,et al.Bitcoin:economics,technology,and governance[J].Journal of Economic Perspectives,2015,29(2):213-238.
[17]Ethereum White Paper.A next-generation smart contract anddecentralized application platform[EB/OL].https://github.com/ethereum /wiki/wiki/White-Paper,2015.
[18]BUTERIN V.A next-generation smart contract and decentra-lized application platform[OL].https://ethereum.org/en/whitepaper/.
[19]Tencent FiT,Tencent Research Institute.Whitepaper for ten-cent trustSQL[EB/OL].https://trustsql.qq.com/.
[20]MCCONAGHY T,MARQUES R,MULLER A,et al.BigchainDB:A Scalable Blockchain Database[EB/OL].(2016-06-08).https://www.bigchaindb.com/whitepaper/bigchaindb-whitepaper.pdf.
[21]LI Y,ZHENG K,YAN Y,et al.EtherQL:a query layer forblockchain system[C]//International Conference on Database Systems for Advanced Applications.Cham:Springer,2017:556-567.
[1] WANG Zi-kai, ZHU Jian, ZHANG Bo-jun, HU Kai. Research and Implementation of Parallel Method in Blockchain and Smart Contract [J]. Computer Science, 2022, 49(9): 312-317.
[2] HUANG Song, DU Jin-hu, WANG Xing-ya, SUN Jin-lei. Survey of Ethereum Smart Contract Fuzzing Technology Research [J]. Computer Science, 2022, 49(8): 294-305.
[3] ZHOU Hang, JIANG He, ZHAO Yan, XIE Xiang-peng. Study on Optimal Scheduling of Power Blockchain System for Consensus Transaction ofEach Unit [J]. Computer Science, 2022, 49(6A): 771-776.
[4] LI Bo, XIANG Hai-yun, ZHANG Yu-xiang, LIAO Hao-de. Application Research of PBFT Optimization Algorithm for Food Traceability Scenarios [J]. Computer Science, 2022, 49(6A): 723-728.
[5] FU Li-yu, LU Ge-hao, WU Yi-ming, LUO Ya-ling. Overview of Research and Development of Blockchain Technology [J]. Computer Science, 2022, 49(6A): 447-461.
[6] GAO Jian-bo, ZHANG Jia-shuo, LI Qing-shan, CHEN Zhong. RegLang:A Smart Contract Programming Language for Regulation [J]. Computer Science, 2022, 49(6A): 462-468.
[7] WEI Hong-ru, LI Si-yue, GUO Yong-hao. Secret Reconstruction Protocol Based on Smart Contract [J]. Computer Science, 2022, 49(6A): 469-473.
[8] MAO Dian-hui, HUANG Hui-yu, ZHAO Shuang. Study on Automatic Synthetic News Detection Method Complying with Regulatory Compliance [J]. Computer Science, 2022, 49(6A): 523-530.
[9] WANG Si-ming, TAN Bei-hai, YU Rong. Blockchain Sharding and Incentive Mechanism for 6G Dependable Intelligence [J]. Computer Science, 2022, 49(6): 32-38.
[10] SUN Hao, MAO Han-yu, ZHANG Yan-feng, YU Ge, XU Shi-cheng, HE Guang-yu. Development and Application of Blockchain Cross-chain Technology [J]. Computer Science, 2022, 49(5): 287-295.
[11] YANG Zhen, HUANG Song, ZHENG Chang-you. Study on Crowdsourced Testing Intellectual Property Protection Technology Based on Blockchain and Improved CP-ABE [J]. Computer Science, 2022, 49(5): 325-332.
[12] REN Chang, ZHAO Hong, JIANG Hua. Quantum Secured-Byzantine Fault Tolerance Blockchain Consensus Mechanism [J]. Computer Science, 2022, 49(5): 333-340.
[13] FENG Liao-liao, DING Yan, LIU Kun-lin, MA Ke-lin, CHANG Jun-sheng. Research Advance on BFT Consensus Algorithms [J]. Computer Science, 2022, 49(4): 329-339.
[14] YANG Xin-yu, PENG Chang-gen, YANG Hui, DING Hong-fa. Rational PBFT Consensus Algorithm with Evolutionary Game [J]. Computer Science, 2022, 49(3): 360-370.
[15] WANG Xin, ZHOU Ze-bao, YU Yun, CHEN Yu-xu, REN Hao-wen, JIANG Yi-bo, SUN Ling-yun. Reliable Incentive Mechanism for Federated Learning of Electric Metering Data [J]. Computer Science, 2022, 49(3): 31-38.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!