Coder Social home page Coder Social logo

zyongchun / newsql-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wt-hu/newsql-engine

0.0 0.0 0.0 51 KB

本项目使用C++实现基于跳表实现的轻量级键值型存储引擎,其主要功能有:插入数据、查询数据、删除数据、数据展示、数据库大小、数据库清空、数据落盘以及文件加载数据。

License: GNU General Public License v3.0

Shell 0.43% C++ 98.72% Makefile 0.85%

newsql-engine's Introduction

NewSQL-Engine (轻量级键值型存储引擎)

NewSQL 是对各种新的可扩展/高性能数据库的简称,这类数据库不仅具有NoSQL对海量数据的存储管理能力,还保持了传统数据库支持ACID和SQL等特性。其中,非关系型数据库redis,以及levedb,rockdb其核心存储引擎的数据结构就是跳表。

本项目就是基于跳表实现的轻量级键值型存储引擎,使用C++实现。插入数据、删除数据、查询数据、数据展示、数据落盘、文件加载数据,以及数据库大小显示。

在随机写读情况下,该项目每秒可处理啊请求数(QPS): 23.61w,每秒可处理读请求数(QPS): 18.66w(测试条件基于实验室服务器下,不同性能和环境有影响)

项目中文件

  • main.cpp 包含skiplist.h使用跳表进行数据操作
  • skiplist.h 存储引擎核心(跳表)实现
  • bin 生成可执行文件目录(.main 和 .stress)
  • makefile 编译脚本
  • store 数据落盘的文件夹(dumpFile)
  • stress_test_start.sh 压力测试脚本
  • LICENSE 使用协议
  • README.md 中文介绍

skliplist主要提供接口

  • insertElement(插入数据)
  • deleteElement(删除数据)
  • searchElement(查询数据)
  • displayList(展示已存数据)
  • dumpFile(数据落盘)
  • loadFile(加载数据)
  • size(返回数据规模)

项目运行方式

make                 // complie demo main.cpp
./bin/main 10     // 10 为最大跳表树高,可自由更改

运行如下脚本测试kv存储引擎的性能(读写分开测试)

sh stress_test_start.sh

存储引擎数据表现

(最大跳表树高:16 , 线程为5)

插入操作

采用随机插入数据测试:

插入数据规模(万条) 耗时(秒)
10 0.47148
50 2.56373
100 4.10648

每秒可处理写请求数(QPS): 23.61w

取数据操作

取数据规模(万条) 耗时(秒)
10 0.52763
50 2.70834
100 5.35979

每秒可处理读请求数(QPS): 18.66w

newsql-engine's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.