Skip to content

Commit 791113a

Browse files
authored
feat: Implement a simple backend for Google BigTable (#64)
First iteration of a Google BigTable backend that supports - Concurrent uploads and downloads - Table management: Automatically creates the table, column families, and GC policies. - Overwriting objects: When calling `put` on an object that exists, the old one will be deleted along with its metadata. - TTL and TTI: Automatic expiry of objects after a time-to-live, as well as automatic bumping via time-to-idle. The latter has to be implemented as re-inserting, so the bump is debounced to once per day. - Metadata storage: Encodes the metadata map, including custom metadata, into a dedicated column. Locally and in CI this is tested using the BigTable Emulator. The emulator is also added to devservices for convenience. Unfortunately, we had to bring back `protoc` since this is required by one of the dependencies. Future improvements: - Chunking to store objects larger than 10 MB efficiently - Multi-fetching of more than one object at a time - (TBD) Splitting metadata into dedicated columns Closes FS-107
1 parent c1fbe87 commit 791113a

File tree

13 files changed

+1293
-24
lines changed

13 files changed

+1293
-24
lines changed

.envrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
#!/bin/bash
2+
3+
# Our policy is that the .envrc is entirely optional, and a user
4+
# without direnv should not really have a worse dev experience in any way.
5+
6+
# Use with `devservices up objectstore --mode=full`
7+
export BIGTABLE_EMULATOR_HOST=localhost:8086
8+
19
source_env_if_exists .envrc.private

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
rustup toolchain install stable --profile minimal --no-self-update
2525
rustup component add clippy rustfmt rust-docs --toolchain stable
2626
27+
- name: Install protoc
28+
uses: arduino/setup-protoc@v3
29+
with:
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
2732
- uses: swatinem/rust-cache@v2
2833
with:
2934
key: ${{ github.job }}
@@ -46,16 +51,31 @@ jobs:
4651
steps:
4752
- uses: actions/checkout@v4
4853

54+
- name: Start Bigtable Emulator
55+
run: |
56+
docker run -d \
57+
--name bigtable-emulator \
58+
-p 8086:8086 \
59+
google/cloud-sdk \
60+
gcloud beta emulators bigtable start --host-port=0.0.0.0:8086
61+
4962
- name: Install Rust Toolchain
5063
run: |
5164
rustup toolchain install stable --profile minimal --no-self-update
5265
66+
- name: Install protoc
67+
uses: arduino/setup-protoc@v3
68+
with:
69+
repo-token: ${{ secrets.GITHUB_TOKEN }}
70+
5371
- uses: swatinem/rust-cache@v2
5472
with:
5573
key: ${{ github.job }}
5674

5775
- name: Run Tests
5876
run: cargo test --workspace --all-features
77+
env:
78+
BIGTABLE_EMULATOR_HOST: localhost:8086
5979

6080
docs:
6181
name: Cargo Docs
@@ -72,6 +92,11 @@ jobs:
7292
- name: Install Rust Toolchain
7393
run: rustup toolchain install stable --profile minimal --component rust-docs --no-self-update
7494

95+
- name: Install protoc
96+
uses: arduino/setup-protoc@v3
97+
with:
98+
repo-token: ${{ secrets.GITHUB_TOKEN }}
99+
75100
- uses: swatinem/rust-cache@v2
76101
with:
77102
key: ${{ github.job }}

0 commit comments

Comments
 (0)