Skip to content

feat: grpc proto definitions + codegen infrastructure - #116

Merged
kacy merged 3 commits into
mainfrom
feat/grpc-proto
Feb 14, 2026
Merged

feat: grpc proto definitions + codegen infrastructure#116
kacy merged 3 commits into
mainfrom
feat/grpc-proto

Conversation

@kacy

@kacy kacy commented Feb 14, 2026

Copy link
Copy Markdown
Owner

summary

adds the protobuf service definition and build infrastructure for grpc support
alongside RESP3. this is the foundation for PRs that follow (grpc server impl,
go client, python client).

  • proto/ember/v1/ember.proto: full service definition covering strings, keys,
    lists, hashes, sets, sorted sets, vectors, server commands, and bidirectional
    streaming pipeline
  • grpc feature flag in ember-server (opt-in, not in defaults)
  • tonic 0.13 + prost 0.13 workspace deps
  • build.rs for tonic codegen behind #[cfg(feature = "grpc")]
  • CI installs protoc and tests with grpc feature
  • Dockerfile adds protobuf-compiler and builds with grpc

key design decisions:

  • packed float vectors: repeated float vector = 3 [packed = true] sends
    IEEE 754 bytes directly — eliminates the s.parse::<f32>() bottleneck that
    costs 80% of VADD CPU time over RESP3
  • versioned package (ember.v1): allows future breaking changes without
    affecting existing clients
  • shared response types: IntResponse, BoolResponse, etc. match how
    ShardResponse works internally
  • pipeline rpc: bidirectional streaming for batch operations

what was tested

  • cargo build -p ember-server --features grpc — compiles cleanly
  • cargo build -p ember-server — no regression without feature
  • cargo clippy -p ember-server --features grpc -- -D warnings — clean
  • cargo test -p ember-server --features grpc — 43/43 pass
  • cargo fmt --all --check — clean

design considerations

the grpc feature is intentionally not in default features. users opt in at
compile time, and at runtime the grpc listener only starts when --grpc-port is
passed (coming in the next PR). this keeps the default binary size minimal for
users who only need RESP3.

kacy added 3 commits February 14, 2026 10:38
single service covering all command groups: strings, keys, lists,
hashes, sets, sorted sets, vectors, and server commands. includes
bidirectional Pipeline rpc for batch operations.

key design decisions:
- packed float vectors for zero-parse VADD/VSIM
- versioned package (ember.v1) for future compatibility
- shared response types matching ShardResponse semantics
- go_package option for client codegen
workspace dependencies: tonic 0.13, prost 0.13, tonic-build 0.13.
ember-server gets a new `grpc` feature (not in defaults) that pulls
in tonic, prost, and tonic-build. build.rs runs tonic codegen when
the feature is enabled.
- makefile: add proto-gen target, include grpc in test/clippy features
- ci: install protoc, enable grpc feature in check/test jobs
- dockerfile: add protobuf-compiler, build with grpc, expose port 6380
@kacy
kacy merged commit 8942294 into main Feb 14, 2026
7 checks passed
@kacy
kacy deleted the feat/grpc-proto branch February 14, 2026 16:11
kacy added a commit that referenced this pull request Feb 19, 2026
* add grpc proto definitions for ember.v1 service

single service covering all command groups: strings, keys, lists,
hashes, sets, sorted sets, vectors, and server commands. includes
bidirectional Pipeline rpc for batch operations.

key design decisions:
- packed float vectors for zero-parse VADD/VSIM
- versioned package (ember.v1) for future compatibility
- shared response types matching ShardResponse semantics
- go_package option for client codegen

* add tonic/prost deps and grpc feature flag

workspace dependencies: tonic 0.13, prost 0.13, tonic-build 0.13.
ember-server gets a new `grpc` feature (not in defaults) that pulls
in tonic, prost, and tonic-build. build.rs runs tonic codegen when
the feature is enabled.

* update build infra for grpc support

- makefile: add proto-gen target, include grpc in test/clippy features
- ci: install protoc, enable grpc feature in check/test jobs
- dockerfile: add protobuf-compiler, build with grpc, expose port 6380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant