Skip to content

Commit 8607456

Browse files
authored
Merge pull request #422 from bootjp/copilot/update-s3-redis-storage-info
docs: reflect S3-compatible storage adapter and expanded Redis compatibility in README and architecture
2 parents b5ca16c + dbbf702 commit 8607456

2 files changed

Lines changed: 75 additions & 12 deletions

File tree

README.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ Elastickv is an experimental project undertaking the challenge of creating a dis
99
- **Raft-based Data Replication**: KV state replication is implemented on Raft, with leader-based commit and follower forwarding paths.
1010
- **Shard-aware Data Plane**: Static shard ranges across multiple Raft groups with shard routing/coordinator are implemented.
1111
- **Durable Route Control Plane (Milestone 1)**: Durable route catalog, versioned route snapshot apply, watcher-based route refresh, and manual `ListRoutes`/`SplitRange` (same-group split) are implemented.
12-
- **Protocol Adapters**: gRPC (`RawKV`/`TransactionalKV`), Redis (core commands + `MULTI/EXEC` and list operations), and DynamoDB-compatible API (`PutItem`/`GetItem`/`DeleteItem`/`UpdateItem`/`Query`/`Scan`/`BatchWriteItem`/`TransactWriteItems`) implementations are available (runtime exposure depends on the selected server entrypoint/configuration).
12+
- **Protocol Adapters**: gRPC (`RawKV`/`TransactionalKV`), Redis-compatible server, DynamoDB-compatible HTTP API, and S3-compatible HTTP API implementations are available (runtime exposure depends on the selected server entrypoint/configuration).
13+
- **Redis Compatibility Scope**: Strings, hashes, lists, sets, sorted sets, HyperLogLog, streams (`XADD`/`XREAD`/`XRANGE`/`XREVRANGE`/`XTRIM`/`XLEN`), Pub/Sub (`PUBLISH`/`SUBSCRIBE`), transactions (`MULTI`/`EXEC`/`DISCARD`), TTL/expiry (`EXPIRE`/`PEXPIRE`/`TTL`/`PTTL`), key scanning (`KEYS`/`SCAN`), and Lua scripting (`EVAL`/`EVALSHA`) are implemented. A Redis-protocol reverse proxy (`cmd/redis-proxy`) supports phased zero-downtime migration from existing Redis deployments.
1314
- **DynamoDB Compatibility Scope**: `CreateTable`/`DeleteTable`/`DescribeTable`/`ListTables`/`PutItem`/`GetItem`/`DeleteItem`/`UpdateItem`/`Query`/`Scan`/`BatchWriteItem`/`TransactWriteItems` are implemented.
15+
- **S3 Compatibility Scope**: `ListBuckets`, `CreateBucket`, `HeadBucket`, `DeleteBucket`, `PutObject`, `GetObject`, `HeadObject`, `DeleteObject`, and `ListObjectsV2` (path-style) are implemented. AWS Signature Version 4 authentication with static credentials is supported. The server exposes an S3-compatible HTTP endpoint via `--s3Address`.
1416
- **Basic Consistency Behaviors**: Write-after-read checks, leader redirection/forwarding paths, and OCC conflict detection for transactional writes are covered by tests.
1517

1618
## Planned Features
@@ -29,6 +31,11 @@ Architecture diagrams are available in:
2931
Deployment/runbook documents:
3032

3133
- `docs/docker_multinode_manual_run.md` (manual `docker run`, 4-5 node cluster on multiple VMs, no docker compose)
34+
- `docs/redis-proxy-deployment.md` (Redis-protocol reverse proxy for zero-downtime Redis-to-Elastickv migration)
35+
36+
Design documents:
37+
38+
- `docs/s3_compatible_adapter_design.md` (S3-compatible object storage adapter design, data model, routing, and rollout plan)
3239

3340
## Metrics and Grafana
3441

@@ -110,6 +117,9 @@ go run . \
110117
--address "127.0.0.1:50051" \
111118
--redisAddress "127.0.0.1:6379" \
112119
--dynamoAddress "127.0.0.1:8000" \
120+
--s3Address "127.0.0.1:9000" \
121+
--s3Region "us-east-1" \
122+
--s3CredentialsFile "/etc/elastickv/s3creds.json" \
113123
--metricsAddress "127.0.0.1:9090" \
114124
--raftId "n1"
115125
```
@@ -135,6 +145,53 @@ get key
135145
quit
136146
```
137147

148+
#### Sorted Sets, Streams, and Other Data Structures
149+
The Redis adapter supports the full range of Redis data structures including sorted sets (`ZADD`/`ZRANGE`/`ZSCORE`), HyperLogLog (`PFADD`/`PFCOUNT`), streams (`XADD`/`XREAD`/`XRANGE`), sets (`SADD`/`SMEMBERS`), hashes (`HGET`/`HSET`/`HGETALL`), and Pub/Sub (`PUBLISH`/`SUBSCRIBE`). Lua scripts can be executed via `EVAL` and `EVALSHA`.
150+
151+
#### Migrating from Redis
152+
153+
A Redis-protocol reverse proxy (`redis-proxy`) enables phased zero-downtime migration. It supports dual-write, shadow-read comparison, and primary cutover modes. See `docs/redis-proxy-deployment.md` for the full deployment guide.
154+
155+
```bash
156+
# Run redis-proxy in dual-write mode (writes to both Redis and Elastickv)
157+
# The proxy listens on :6479 inside the container, exposed as :6379 on the host
158+
# so existing clients can connect without changing their configuration.
159+
docker run --rm \
160+
-p 6379:6479 \
161+
ghcr.io/bootjp/elastickv/redis-proxy:latest \
162+
-listen :6479 \
163+
-primary redis.internal:6379 \
164+
-secondary elastickv.internal:6380 \
165+
-mode dual-write
166+
```
167+
168+
### Working with S3-compatible Storage
169+
170+
Elastickv exposes an S3-compatible HTTP API on `--s3Address` (default `:9000`). Any S3 client or SDK that supports path-style requests and AWS Signature Version 4 can connect to it.
171+
172+
```bash
173+
# Configure the AWS CLI to point at Elastickv
174+
aws configure set aws_access_key_id YOUR_ACCESS_KEY
175+
aws configure set aws_secret_access_key YOUR_SECRET_KEY
176+
177+
# Create a bucket
178+
aws --endpoint-url http://localhost:9000 s3api create-bucket --bucket my-bucket
179+
180+
# Upload an object
181+
aws --endpoint-url http://localhost:9000 s3api put-object \
182+
--bucket my-bucket --key hello.txt --body hello.txt
183+
184+
# Download an object
185+
aws --endpoint-url http://localhost:9000 s3api get-object \
186+
--bucket my-bucket --key hello.txt /tmp/hello.txt
187+
188+
# List objects
189+
aws --endpoint-url http://localhost:9000 s3api list-objects-v2 \
190+
--bucket my-bucket
191+
```
192+
193+
See `docs/s3_compatible_adapter_design.md` for the full data model, consistency guarantees, multipart upload design, and rollout plan.
194+
138195
### Connecting to a Follower Node
139196
To connect to a follower node:
140197
```bash

docs/architecture_overview.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ flowchart TB
1111
DC["DynamoDB Client"]
1212
GC["gRPC RawKV/Transactional Client"]
1313
OC["Operator Client (grpcurl/SDK)"]
14+
SC["S3 Client (AWS CLI / SDKs / rclone)"]
15+
RP["redis-proxy (cmd/redis-proxy)"]
1416
end
1517
1618
subgraph Node["Elastickv Node Process"]
@@ -19,10 +21,11 @@ flowchart TB
1921
DBS["DynamoDB Server (adapter/dynamodb.go)"]
2022
GS["gRPC Server (adapter/grpc.go)"]
2123
DS["Distribution Server (adapter/distribution_server.go)"]
24+
S3S["S3 Server (adapter/s3.go)"]
2225
end
2326
2427
subgraph DataPlane["Data Plane"]
25-
SC["Sharded Coordinator (kv/sharded_coordinator.go)"]
28+
SCC["Sharded Coordinator (kv/sharded_coordinator.go)"]
2629
SS["Shard Store (kv/shard_store.go)"]
2730
SR["Shard Router (kv/shard_router.go)"]
2831
end
@@ -44,20 +47,23 @@ flowchart TB
4447
DC --> DBS
4548
GC --> GS
4649
OC --> DS
50+
SC --> S3S
51+
RP --> RS
4752
48-
RS --> SC
49-
DBS --> SC
50-
GS --> SC
53+
RS --> SCC
54+
DBS --> SCC
55+
GS --> SCC
5156
GS --> SS
52-
SC --> SR
53-
SC --> DE
57+
S3S --> SCC
58+
SCC --> SR
59+
SCC --> DE
5460
SS --> DE
5561
56-
DS --> SC
62+
DS --> SCC
5763
DS --> CS
5864
5965
SR --> RG
60-
SC --> RG
66+
SCC --> RG
6167
SS --> RG
6268
RG --> FSM
6369
FSM --> MV
@@ -73,23 +79,23 @@ flowchart TB
7379
flowchart LR
7480
subgraph Cluster["Elastickv Cluster"]
7581
subgraph N1["Node A"]
76-
AIN["Ingress (gRPC/Redis/DynamoDB)"]
82+
AIN["Ingress (gRPC/Redis/DynamoDB/S3)"]
7783
ADE["Route Engine"]
7884
ACW["Catalog Watcher"]
7985
ARG0["Default Group Runtime (Catalog Keys)"]
8086
ARG1["User Group Runtime(s)"]
8187
end
8288
8389
subgraph N2["Node B"]
84-
BIN["Ingress (gRPC/Redis/DynamoDB)"]
90+
BIN["Ingress (gRPC/Redis/DynamoDB/S3)"]
8591
BDE["Route Engine"]
8692
BCW["Catalog Watcher"]
8793
BRG0["Default Group Runtime (Catalog Keys)"]
8894
BRG1["User Group Runtime(s)"]
8995
end
9096
9197
subgraph N3["Node C"]
92-
CIN["Ingress (gRPC/Redis/DynamoDB)"]
98+
CIN["Ingress (gRPC/Redis/DynamoDB/S3)"]
9399
CDE["Route Engine"]
94100
CCW["Catalog Watcher"]
95101
CRG0["Default Group Runtime (Catalog Keys)"]

0 commit comments

Comments
 (0)