Skip to content

feat: Add async feature store interface and in-memory implementation#457

Merged
jsonbailey merged 2 commits into
mainfrom
jb/sdk-60/async-feature-store
Jul 16, 2026
Merged

feat: Add async feature store interface and in-memory implementation#457
jsonbailey merged 2 commits into
mainfrom
jb/sdk-60/async-feature-store

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

BEGIN_COMMIT_OVERRIDE
chore: Add async feature store interface and in-memory implementation
END_COMMIT_OVERRIDE

Stacked on #451 (async support classes). Review/merge that first; this PR's diff is against that branch.

Tracked internally: SDK-2671

What

The async data-store foundation the async SDK builds on.

  • interfaces.py — async interfaces: AsyncFeatureStore, AsyncReadOnlyStore (async get/all; the async analog of ReadOnlyStore), AsyncDataSourceUpdateSink, AsyncBigSegmentStore, AsyncInitializer, AsyncSynchronizer. Pure additions alongside the existing sync interfaces.
  • async_feature_store.pyAsyncInMemoryFeatureStore. Holds no lock: every method reads/mutates its dict without awaiting in between, so it runs to completion without the event loop switching coroutines (the sync twin needs a ReadWriteLock because threads can preempt each other).
  • testing/ — async test utilities: mock_async_components.py, async_feature_store_test_base.py, and test_async_in_memory_feature_store.py.

Why

Foundation for the async Python SDK (epic SDK-60). Subsequent slices (async evaluator, big segments, data sources, data systems, client) depend on these interfaces and the in-memory store.

Validation

  • uv run pytest ldclient/testing/test_async_in_memory_feature_store.py — 17 passed
  • uv run mypy ldclient — clean
  • isort / pycodestyle — clean

Epic SDK-60.


Note

Low Risk
Additive experimental APIs and in-memory store with no changes to existing sync behavior; risk is mainly API churn before production readiness.

Overview
Adds the async data-store foundation for the experimental async Python SDK: new async counterparts to the sync flag-data plumbing, plus a default in-memory implementation and shared tests.

interfaces.py gains async APIs alongside existing sync types: AsyncReadOnlyStore, AsyncFeatureStore (versioned init/upsert/delete, upsert returns whether an update applied), AsyncDataSourceUpdateSink, AsyncBigSegmentStore, and FDv2-style AsyncInitializer / AsyncSynchronizer (async fetch and async-generator sync). All are marked experimental.

async_feature_store.py introduces AsyncInMemoryFeatureStore, mirroring sync in-memory versioning and tombstone delete semantics but without a ReadWriteLock—methods do not await between reads/writes, so dict updates run atomically on the event loop.

testing/ adds AsyncFeatureStoreTestBase (async port of the sync store contract tests), MockAsyncFeatureStore / MockAsyncEventProcessor / MockAsyncUpdateProcessor, and test_async_in_memory_feature_store.py wiring the in-memory store through that suite.

Reviewed by Cursor Bugbot for commit 9966c03. Bugbot is set up for automated code reviews on this repo. Configure here.

@jsonbailey
jsonbailey marked this pull request as ready for review July 10, 2026 22:40
@jsonbailey
jsonbailey requested a review from a team as a code owner July 10, 2026 22:40
Comment thread ldclient/async_feature_store.py Outdated
Base automatically changed from jb/sdk-2601/async-shim-layer to main July 16, 2026 15:50
Adds the async interfaces (AsyncFeatureStore, AsyncReadOnlyStore, AsyncDataSourceUpdateSink, AsyncBigSegmentStore, AsyncInitializer, AsyncSynchronizer), the AsyncInMemoryFeatureStore, and async test utilities. Stacked on the async support classes slice.
@jsonbailey
jsonbailey force-pushed the jb/sdk-60/async-feature-store branch from bbe77d7 to 9709ea1 Compare July 16, 2026 16:28
@jsonbailey
jsonbailey merged commit d0436a1 into main Jul 16, 2026
15 checks passed
@jsonbailey
jsonbailey deleted the jb/sdk-60/async-feature-store branch July 16, 2026 20:40
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.

3 participants