Merged
Conversation
ETS provides lower-latency rate limiting by using atomic table operations directly, avoiding the overhead of OTP actor messages. Suitable for single-node deployments where low latency is important. - ets_store.gleam: EtsStore type implementing bucket.Store interface - ets_store_ffi.erl: Erlang FFI for ETS operations (new/get/set/delete/sweep/size) - glimit.ets_store() builder for easy integration - Periodic sweep timer for cleaning up full and idle buckets - 10 new tests covering all ETS store functionality
Document the new ETS-backed storage backend with usage example, performance characteristics, and comparison to in-memory mode.
2 tasks
Owner
|
Hi @rapind, thank you very much for these PR's. I'll code review them this weekend. Would this be an option to use as the default in-memory backend? What do you think? |
Contributor
Author
Yes, 100% it's an upgrade. Same behaviour without the serialization bottleneck. I can rework this PR to replace the default if you like. |
Owner
|
@rapind That would be great! I think there would be no use for the current in-memory backend (OTP actor), so it would be awesome if this could completely replace that. Let me know if I could help, thank you very much for contributing! |
Replace the OTP actor-based in-memory store with ETS as the default. ETS provides lower-latency, lock-free rate limiting without actor message overhead. Remove memory_store module entirely — custom stores can still be plugged in via glimit.store().
Contributor
Author
|
All set. |
Owner
|
@rapind Thank you for helping! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
glimit/ets_storemodule, an ETS-backed implementation ofbucket.Storemessages. Suitable for single-node deployments where low latency matters.
glimit.ets_store()builder for easy integrationUsage
Test plan