Skip to content

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

Open
jsonbailey wants to merge 1 commit into
jb/sdk-2601/async-shim-layerfrom
jb/sdk-60/async-feature-store
Open

feat: Add async feature store interface and in-memory implementation#457
jsonbailey wants to merge 1 commit into
jb/sdk-2601/async-shim-layerfrom
jb/sdk-60/async-feature-store

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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

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 an in-memory reference implementation with broad test coverage; no changes to existing sync evaluation or storage paths.

Overview
Adds the experimental async data-store layer for the upcoming async Python SDK: new protocols/ABCs in interfaces.py and a default in-memory store, plus shared tests and mocks.

interfaces.py gains async counterparts to the sync data path—AsyncReadOnlyStore, AsyncFeatureStore (versioned get/all/init/upsert/delete, initialized, optional close), AsyncDataSourceUpdateSink, AsyncBigSegmentStore, and FDv2-style AsyncInitializer / AsyncSynchronizer (async fetch and async-generator sync). Existing sync types are unchanged.

async_feature_store.py introduces AsyncInMemoryFeatureStore, mirroring sync in-memory versioning and tombstone semantics but without a ReadWriteLock; methods do not await between dict reads/writes, so work completes on one event-loop turn.

testing/ adds AsyncFeatureStoreTestBase (parity with the sync store test suite), MockAsyncFeatureStore / MockAsyncEventProcessor / MockAsyncUpdateProcessor, and test_async_in_memory_feature_store.py wiring the in-memory implementation through that base.

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

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 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
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