Skip to content

Commit

Permalink
merge unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexStocks committed Aug 28, 2024
2 parents 58c3b0f + 54b2dcd commit 27c8f0a
Show file tree
Hide file tree
Showing 102 changed files with 430 additions and 432 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1-bug-report.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug Report
description: Report a bug in the PikiwiDB
description: Report a bug in the kiwi
labels: [ "☢️ Bug" ]

body:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/2-feature-request.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'Feature Request'
description: Suggest a feature for PikiwiDB
description: Suggest a feature for kiwi
labels: [ "✏️ Feature" ]

body:
- type: dropdown
id: affected-packages
attributes:
label: Which PikiwiDB functionalities are relevant/related to the feature request?
label: Which kiwi functionalities are relevant/related to the feature request?
options:
- other
multiple: true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/3-docs-bug.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Docs or PikiwiDB Bug Report'
description: Report an issue in PikiwiDB's documentation
name: 'Docs or kiwi Bug Report'
description: Report an issue in kiwi's documentation
labels: [ "📒 Documentation" ]

body:
Expand Down
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ template: |
Version tags:
- `https://github.com/$OWNER/$REPOSITORY/releases/tag/v$RESOLVED_VERSION`
**📒 Documentation**: PikiwiDB
**📒 Documentation**: kiwi
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/import_braft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
cd ../tests
go mod tidy
go test ./pikiwidb_suite_test.go ./consistency_test.go -v
go test ./kiwi_suite_test.go ./consistency_test.go -v
build_on_ubuntu:
runs-on: ubuntu-latest
Expand All @@ -57,4 +57,4 @@ jobs:
run: |
cd ../tests
go mod tidy
go test ./pikiwidb_suite_test.go ./consistency_test.go -v
go test ./kiwi_suite_test.go ./consistency_test.go -v
6 changes: 3 additions & 3 deletions .github/workflows/pikiwidb.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pikiwidb
name: kiwi

on:
push:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Run TCL E2e Tests
working-directory: ${{ github.workspace }}
run:
./etc/script/pikiwidbtests.sh all
./etc/script/kiwitests.sh all

- name: Run Go E2E Tests
working-directory: ${{ github.workspace }}/build-release
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Run TCL E2e Tests
working-directory: ${{ github.workspace }}
run:
./etc/script/pikiwidbtests.sh all
./etc/script/kiwitests.sh all

- name: Run Go E2E Tests
working-directory: ${{ github.workspace }}/build-release
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "samples"]
path = samples
url = git@github.com:OpenAtomFoundation/pikiwidb.git
url = git@github.com:OpenAtomFoundation/kiwi.git
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# of patent rights can be found in the PATENTS file in the same directory.

CMAKE_MINIMUM_REQUIRED(VERSION 3.14)
PROJECT(PikiwiDB)
PROJECT(kiwi)
include(GNUInstallDirs)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type")
Expand Down
36 changes: 17 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PikiwiDB
![](docs/images/pikiwidb-logo.png)
# Kiwi
![](docs/images/Kiwi-logo.png)
[中文](README_CN.md)

A C++20 implementation of Redis Server, use RocksDB for persist storage.(not including cluster yet)
Expand All @@ -8,27 +8,25 @@ A C++20 implementation of Redis Server, use RocksDB for persist storage.(not inc

* Linux or OS X or FreeBSD

## Compile

**It is recommended to use the latest version of Ubuntu or Debian for Linux systems**

Execute compilation

Execute the following commands on Rocky Linux:

```bash
```shell
# Rocky Linux, Fedora Linux, CentOS
sudo dnf groupinstall -y 'Development Tools'
sudo dnf install cmake g++ autoconf perl -y
git config --global http.version HTTP/1.1
# Ubuntu
sudo apt install cmake g++ autoconf perl -y
git config --global http.version HTTP/1.1
```

Execute this command to start compiling Pikiwidb:
## Compile

Execute this command to start compiling Kiwi:

```bash
./etc/script/build.sh
```

Pikiwidb is compiled by default in release mode, which does not support debugging. If debugging is needed, compile in debug mode.
Kiwi is compiled by default in release mode, which does not support debugging. If debugging is needed, compile in debug mode.

```bash
./etc/script/build.sh --clear
Expand All @@ -38,21 +36,21 @@ Pikiwidb is compiled by default in release mode, which does not support debuggin
## Run

```bash
./bin/pikiwidb ./etc/conf/pikiwidb.conf
./bin/kiwi ./etc/conf/Kiwi.conf
```

## Support module for write your own extensions
PikiwiDB supports module now, still in progress, much work to do.
Kiwi supports module now, still in progress, much work to do.
I added three commands(ldel, skeys, hgets) for demonstration.

## Persistence: Not limited to memory
RocksDB can be configured as backend for PikiwiDB.
RocksDB can be configured as backend for Kiwi.

## Fully compatible with redis
You can test PikiwiDB with redis-cli, redis-benchmark, or use redis as master with PikiwiDB as slave or conversely, it also can work with redis sentinel.
You can test Kiwi with redis-cli, redis-benchmark, or use redis as master with Kiwi as slave or conversely, it also can work with redis sentinel.

## High Performance
- PikiwiDB is approximately 20-25% faster than redis if run benchmark with pipeline requests(set -P = 50 or higher).
- Kiwi is approximately 20-25% faster than redis if run benchmark with pipeline requests(set -P = 50 or higher).
- Average 80K requests per seconds for write, and 90K requests per seconds for read.
- Before run test, please ensure that std::list::size() is O(1), obey the C++11 standards.

Expand Down Expand Up @@ -97,5 +95,5 @@ Run this command, compare with redis use pipeline commands, try it.

## Contact Us

![](docs/images/pikiwidb-wechat.png)
![](docs/images/Kiwi-wechat.png)

48 changes: 23 additions & 25 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PikiwiDB
![](docs/images/pikiwidb-logo.png)
# Kiwi
![](docs/images/Kiwi-logo.png)
[Click me switch to English](README.en.md)

C++20 实现的增强版 Redis 服务器,使用 RocksDB 作为持久化存储引擎。(集群支持尚正在计划中)
Expand All @@ -8,27 +8,25 @@ C++20 实现的增强版 Redis 服务器,使用 RocksDB 作为持久化存储引

* Linux 或 MAC OS 或 FreeBSD

## 编译

**建议使用最新版本的 Ubuntu 或 Debian Linux 系统**

执行编译:

在 Rocky Linux 下执行如下的指令:

```bash
```shell
# Rocky Linux, Fedora Linux, CentOS
sudo dnf groupinstall -y 'Development Tools'
sudo dnf install cmake g++ autoconf perl -y
git config --global http.version HTTP/1.1
# Ubuntu
sudo apt install cmake g++ autoconf perl -y
git config --global http.version HTTP/1.1
```

执行以下命令开始编译 PikiwiDB:
## 编译

执行以下命令开始编译 Kiwi:

```bash
./etc/script/build.sh
```

PikiwiDB 默认以 release 模式编译,不支持调试。如果需要调试,请以 debug 模式编译。
Kiwi 默认以 release 模式编译,不支持调试。如果需要调试,请以 debug 模式编译。

```bash
./etc/script/build.sh --clear
Expand All @@ -38,23 +36,23 @@ PikiwiDB 默认以 release 模式编译,不支持调试。如果需要调试
## 运行

```bash
./bin/pikiwidb ./etc/conf/pikiwidb.conf
./bin/kiwi ./etc/conf/Kiwi.conf
```

## 与 Redis 完全兼容

你可以用 Redis 的各种工具来测试 PikiwiDB,比如官方的 redis-cli, redis-benchmark。
你可以用 Redis 的各种工具来测试 Kiwi,比如官方的 redis-cli, redis-benchmark。

PikiwiDB 可以和 Redis 之间进行复制,可以读取 Redis 的 rdb 文件或 aof 文件。当然,PikiwiDB 生成的 aof 或 rdb 文件也可以被 Redis 读取。
Kiwi 可以和 Redis 之间进行复制,可以读取 Redis 的 rdb 文件或 aof 文件。当然,Kiwi 生成的 aof 或 rdb 文件也可以被 Redis 读取。

你还可以用 redis-sentinel 来实现 PikiwiDB 的高可用!
你还可以用 redis-sentinel 来实现 Kiwi 的高可用!

总之,PikiwiDB 与 Redis 完全兼容。
总之,Kiwi 与 Redis 完全兼容。

## 高性能

- PikiwiDB 性能大约比 Redis 3.2 高出 20% (使用 redis-benchmark 测试 pipeline 请求,比如设置 -P=50 或更高)
- PikiwiDB 的高性能有一部分得益于独立的网络线程处理 IO,因此和 redis 比占了便宜。但 PikiwiDB 逻辑仍然是单线程的。
- Kiwi 性能大约比 Redis 3.2 高出 20% (使用 redis-benchmark 测试 pipeline 请求,比如设置 -P=50 或更高)
- Kiwi 的高性能有一部分得益于独立的网络线程处理 IO,因此和 redis 比占了便宜。但 Kiwi 逻辑仍然是单线程的。
- 另一部分得益于 C++ STL 的高效率(CLANG 的表现比 GCC 更好)。
- 在测试前,你要确保 std::list 的 size() 是 O(1) 复杂度,这才遵循 C++11 的标准。否则 list 相关命令不可测。

Expand All @@ -65,18 +63,18 @@ PikiwiDB 可以和 Redis 之间进行复制,可以读取 Redis 的 rdb 文件

## 支持冷数据淘汰

是的,在内存受限的情况下,你可以让 PikiwiDB 根据简单的 LRU 算法淘汰一些 key 以释放内存。
是的,在内存受限的情况下,你可以让 Kiwi 根据简单的 LRU 算法淘汰一些 key 以释放内存。

## 主从复制,事务,RDB/AOF持久化,慢日志,发布订阅

这些特性 PikiwiDB 都有:-)
这些特性 Kiwi 都有:-)

## 持久化:内存不再是上限
RocksDB 可以配置为 PikiwiDB 的持久化存储引擎,可以存储更多的数据。
RocksDB 可以配置为 Kiwi 的持久化存储引擎,可以存储更多的数据。

## 命令列表

#### 展示 PikiwiDB 支持的所有命令
#### 展示 Kiwi 支持的所有命令

- cmdlist

Expand Down Expand Up @@ -123,5 +121,5 @@ RocksDB 可以配置为 PikiwiDB 的持久化存储引擎,可以存储更多

## Contact Us

![](docs/images/pikiwidb-wechat-cn.png)
![](docs/images/Kiwi-wechat-cn.png)

18 changes: 9 additions & 9 deletions etc/conf/pikiwidb.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PikiwiDB configuration file example
# kiwi configuration file example

# By default PikiwiDB does not run as a daemon. Use 'yes' if you need it.
# By default kiwi does not run as a daemon. Use 'yes' if you need it.
daemonize no

# Accept connections on the specified port, default is 9221.
Expand All @@ -16,7 +16,7 @@ ip 127.0.0.1
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0

# Directory to store the data of PikiwiDB.
# Directory to store the data of kiwi.
db-path ./db/

# Specify the server verbosity level.
Expand Down Expand Up @@ -82,7 +82,7 @@ stop-writes-on-bgsave-error yes # not support
# For default that's set to 'yes' as it's almost always a win.
# If you want to save some CPU in the saving child set it to 'no' but
# the dataset will likely be bigger if you have compressible values or keys.
rdbcompression yes # PikiwiDB always use compression for rdb file
rdbcompression yes # kiwi always use compression for rdb file

# Since version 5 of RDB a CRC64 checksum is placed at the end of the file.
# This makes the format more resistant to corruption but there is a performance
Expand All @@ -91,7 +91,7 @@ rdbcompression yes # PikiwiDB always use compression for rdb file
#
# RDB files created with checksum disabled have a checksum of zero that will
# tell the loading code to skip the check.
rdbchecksum yes # PikiwiDB always check sum for rdb file
rdbchecksum yes # kiwi always check sum for rdb file

# The filename where to dump the DB
dbfilename dump.rdb
Expand Down Expand Up @@ -150,7 +150,7 @@ dir ./
# such as CONFIG, DEBUG, and so forth. To a limited extend you can improve
# security of read only slaves using 'rename-command' to shadow all the
# administrative / dangerous commands.
slave-read-only yes # PikiwiDB always set slave read only
slave-read-only yes # kiwi always set slave read only

# Slaves send PINGs to server in a predefined interval. It's possible to change
# this interval with the repl_ping_slave_period option. The default value is 10
Expand Down Expand Up @@ -243,7 +243,7 @@ slave-priority 100 # not support yet
#
maxmemory 999999999999

# MAXMEMORY POLICY: how PikiwiDB will select what to remove when maxmemory
# MAXMEMORY POLICY: how kiwi will select what to remove when maxmemory
# is reached. You can select among five behaviors:
#

Expand All @@ -255,7 +255,7 @@ maxmemory-policy noeviction

# LRU and minimal TTL algorithms are not precise algorithms but approximated
# algorithms (in order to save memory), so you can select as well the sample
# size to check. For instance for default PikiwiDB will check 5 keys and
# size to check. For instance for default kiwi will check 5 keys and
# pick the one that was used less recently, you can change the sample size
# using the following configuration directive.
#
Expand Down Expand Up @@ -315,7 +315,7 @@ slowlog-log-slower-than 10000
slowlog-max-len 128

############################### BACKENDS CONFIG ###############################
# PikiwiDB uses RocksDB as the underlying storage engine, and the data belonging
# kiwi uses RocksDB as the underlying storage engine, and the data belonging
# to the same DB is distributed among several RocksDB instances.

# RocksDB instances number per DB
Expand Down
8 changes: 4 additions & 4 deletions etc/script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ PREFIX="cmake-build"

PWD=`pwd`
PROJECT_HOME="${PWD}/"
CONF="${PROJECT_HOME}/etc/conf/pikiwidb.conf"
CONF="${PROJECT_HOME}/etc/conf/kiwi.conf"

function build() {
if [ ! -f "/proc/cpuinfo" ];then
Expand Down Expand Up @@ -51,10 +51,10 @@ function build() {
cmake --build ${PREFIX} -- ${MAKE_FLAGS} -j ${CPU_CORE}

if [ $? -eq 0 ]; then
# echo -e "pikiwidb compile complete, output file ${C_GREEN} ${PREFIX}/bin/pikiwidb ${C_END}"
echo -e "pikiwidb compile complete, output file ${C_GREEN} ./bin/pikiwidb ${C_END}"
# echo -e "kiwi compile complete, output file ${C_GREEN} ${PREFIX}/bin/kiwi ${C_END}"
echo -e "kiwi compile complete, output file ${C_GREEN} ./bin/kiwi ${C_END}"
else
echo -e "${C_RED} pikiwidb compile fail ${C_END}"
echo -e "${C_RED} kiwi compile fail ${C_END}"
exit 1
fi
}
Expand Down
2 changes: 1 addition & 1 deletion etc/script/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PREFIX="build"

if [ -z "$SHORT_COMMIT_ID" ]; then
echo "no git commit id"
SHORT_COMMIT_ID="pikiwidb"
SHORT_COMMIT_ID="kiwi"
fi

echo "BUILD_TIME:" $BUILD_TIME
Expand Down
Loading

0 comments on commit 27c8f0a

Please sign in to comment.