Skip to content

gKV is a lightweight k-v storage based on golang

License

Notifications You must be signed in to change notification settings

shaojintian/gKV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gKV

A lightweight k-v store based on golang and takes example by redis(C code version).

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Best-README-Template

An awesome README template to jumpstart your projects!
Explore the docs »

View Demo · Report Bug · Request Feature

本篇README.md面向开发者

🚀 功能

  • 支持数据类型:string,zlist,zset,zsortedSet
  • Reactor 模式
  • 持久化机制:支持RDB和AOF
  • 支持集群
  • 支持超时失效
  • API名称完美复刻redis,降低学习成本
  • 优雅退出:client/server接受sigxxx信号结束,并执行持久化存盘
  • 支持订阅发布

🏃‍ 进度

  1. 完成set,get,del,lpush,llen,lrange,append
  2. 正在做: RDB and AOF

🤜 难点

  1. 传输数据make([]byte,len)==[0,0,0,0,0,...,0] 需要截取[:n]否则会有冗余的0
  2. conn,err := netListen.Accept()只接受一次连接
  3. 优雅接受signal:起一个goroutine,因为监听signal不能阻塞主goroutine,让它在新的goroutine中阻塞等待,一但有信号再经过cpu调度处理signal

🌐 展望

  1. 可以考虑之后用共享内存/整理内存算法提高内存利用率,因为不整理会有内存碎片(golang内存管理不佳)

目录

上手指南

请将所有链接中的“shaojintian/gKV”改为“your_github_name/your_repository”

开发前的配置要求
  1. golang >=1.12.5
  2. xxxxx x.x.x
安装步骤
  1. Get a free API Key at https://example.com
  2. Clone the repo
git clone https://github.com/shaojintian/gKV.git
  1. Start server && client
go run server_main.go
go run client_main.go

run each command in different terminal

  1. How to terminate client/server
press on Ctrl+C to close client/server gracefully.

文件目录说明

eg:

开发的架构

请阅读ARCHITECTURE.md 查阅为该项目的架构。

部署

暂无

使用到的框架

💡核心设计

  1. xxxxx
  2. xxxxx
  3. xxxxx

📊性能测试

  1. xxxxx
  2. xxxxx

贡献者

请阅读CONTRIBUTING.md 查阅为该项目做出贡献的开发者。

如何参与开源项目

贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

版本控制

该项目使用Git进行版本管理。您可以在repository参看当前可用版本。

作者

E-mail: [email protected]

知乎:笃行er   qq:1075803623

您也可以在贡献者名单中参看所有参与该项目的开发者。

版权说明

该项目签署了MIT 授权许可,详情请参阅 LICENSE.txt

鸣谢

赞助

If you like this project and want to sponsor the author, you can reward the author using Wechat or Alipay by scanning the following QR code.

About

gKV is a lightweight k-v storage based on golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages