Skip to content

Conversation

@hengfeiyang
Copy link
Contributor

@hengfeiyang hengfeiyang commented Nov 4, 2025

Current version will create memtable for each org and streamType. we will create 3000 memtables if you have 1000 orgs and both write logs, metrics and traces. This is unacceptable in some customers.

This PR implement a new feature that we let multiple orgs write to a same memtable by hashing.

You can enable this feature by set env:

ZO_FEATURE_SHARED_MEMTABLE_ENABLED=true
ZO_MEM_TABLE_BUCKET_NUM=10

This config will maximum create 30 memtables.

  • Compatible for none-shared wal file replay.
  • Test write none-shared wal file.
  • Test write shared org and replay.

Metrics compatible issue

This PR also fixed metrics compatible reduced issue, it is because of we removed __name__ label in the response.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@testdino-playwright-reporter
Copy link

Testdino Test Results

Status Total Passed Failed Skipped Flaky Pass Rate Duration
All tests passed 51 48 0 3 0 94% 4m 31s

View Detailed Results

Copy link
Contributor

@yaga-simha yaga-simha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I guess the 1:1 performance comparison for low intensity usecase will be identical but higher the number of orgs the better this solution scales.

@hengfeiyang hengfeiyang merged commit 5d1ddb0 into main Nov 4, 2025
13 of 15 checks passed
@hengfeiyang hengfeiyang deleted the feat/shared-memtable branch November 4, 2025 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants