Skip to content

feat: Add C bindings for DynamoDB Big Segments store#579

Merged
beekld merged 3 commits into
mainfrom
beeklimt/SDK-2630/dynamodb-big-segments-c-binding
Jul 24, 2026
Merged

feat: Add C bindings for DynamoDB Big Segments store#579
beekld merged 3 commits into
mainfrom
beeklimt/SDK-2630/dynamodb-big-segments-c-binding

Conversation

@beekld

@beekld beekld commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a C binding for DynamoDBBigSegmentStore so C callers can wire the existing DynamoDB Big Segments integration into the SDK's Big Segments config.

New public surface:

  • LDServerBigSegmentsDynamoDBStore opaque handle.
  • struct LDServerBigSegmentsDynamoDBResult with store and error_message fields.
  • LDSERVER_BIGSEGMENTS_DYNAMODBSTORE_ERROR_MESSAGE_SIZE macro.
  • LDServerBigSegmentsDynamoDBStore_New(table_name, prefix, options, out_result) factory.
  • LDServerBigSegmentsDynamoDBStore_Free(store).

Tests:

  • Unit tests for successful creation with and without the options builder (NULL means "AWS SDK default provider chain").
  • End-to-end test against DynamoDB Local: primes a sync timestamp via PrefixedDynamoDBClient::PutBigSegmentSyncTime, wires the store through the C API, and verifies the SDK reports the store available via the Big Segment status listener.

The type name uses config-section-first word order (BigSegments + DynamoDB + Store), matching the sibling Redis Big Segments binding LDServerBigSegmentsRedisStore (#574) and the sibling DynamoDB LazyLoad binding LDServerLazyLoadDynamoDBSource (#576). The options parameter reuses the LDServerDynamoDBClientOptionsBuilder introduced in #576.

Stacked on #576 (DynamoDB LazyLoad source). Please review that PR first.


Note

Low Risk
New C API surface and tests only; behavior delegates to existing DynamoDBBigSegmentStore::Create with no changes to core evaluation or auth paths.

Overview
Exposes the existing DynamoDB Big Segments integration to C callers via a new public header and thin C++ shim, aligned with LDServerBigSegmentsRedisStore and the DynamoDB LazyLoad C API.

LDServerBigSegmentsDynamoDBStore_New takes table name, prefix, and optional LDServerDynamoDBClientOptionsBuilder (NULL uses the AWS default provider chain; non-NULL builder is consumed on entry). Results land in LDServerBigSegmentsDynamoDBResult (store + fixed-size error_message). LDServerBigSegmentsDynamoDBStore_Free is for callers who do not hand ownership to LDServerBigSegmentsBuilder.

The dynamodb-source library build now compiles bindings/dynamodb/dynamodb_big_segment_store.cpp. C binding tests cover creation with/without options, partial-credentials rejection, and a DynamoDB Local E2E path that wires the store into the SDK and asserts Big Segment store status becomes available. Comment typos (ExplicitelyExplicitly) are fixed in related Redis/DynamoDB binding files.

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

@beekld
beekld marked this pull request as ready for review July 2, 2026 00:09
@beekld
beekld requested a review from a team as a code owner July 2, 2026 00:09
* Segments configuration which will take ownership (in which case do not
* call @ref LDServerBigSegmentsDynamoDBStore_Free.)
*/
LD_EXPORT(bool)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we will need stdbool. Which also means we are missing some test case. Or maybe we transiently get stdbool? But it makes me nervous.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not missing test cases, but all of our tests are written in C++, not C. The only coverage we have of this is the example files. gtest is C++ so I can't easily convert them. I filed a task to follow up on this and maybe add some pure C compilation tasks. But that's a bigger task than I wanna put in this PR.

LD_ASSERT_NOT_NULL(prefix);
LD_ASSERT_NOT_NULL(out_result);

// Explicitely zero out the error_message buffer in case the error is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo, but likely a copy/paste typo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed here and in the places it was copy-pasted from.

@beekld
beekld force-pushed the beeklimt/SDK-2629/dynamodb-lazyload-c-binding branch from 8f196b4 to 54d16d8 Compare July 24, 2026 20:53
@beekld
beekld force-pushed the beeklimt/SDK-2630/dynamodb-big-segments-c-binding branch from 538459c to 8c35fe5 Compare July 24, 2026 20:54
Base automatically changed from beeklimt/SDK-2629/dynamodb-lazyload-c-binding to main July 24, 2026 21:23
@beekld
beekld force-pushed the beeklimt/SDK-2630/dynamodb-big-segments-c-binding branch from 63ab95d to 204affd Compare July 24, 2026 21:30

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 204affd. Configure here.

Comment thread libs/server-sdk-dynamodb-source/tests/c_bindings_test.cpp
@beekld
beekld merged commit fc6c075 into main Jul 24, 2026
49 checks passed
@beekld
beekld deleted the beeklimt/SDK-2630/dynamodb-big-segments-c-binding branch July 24, 2026 22:29
@github-actions github-actions Bot mentioned this pull request Jul 24, 2026
beekld pushed a commit that referenced this pull request Jul 24, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-cpp-client: 3.11.3</summary>

##
[3.11.3](launchdarkly-cpp-client-v3.11.2...launchdarkly-cpp-client-v3.11.3)
(2026-07-24)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-internal bumped from 0.14.0 to 0.14.1
</details>

<details><summary>launchdarkly-cpp-internal: 0.14.1</summary>

##
[0.14.1](launchdarkly-cpp-internal-v0.14.0...launchdarkly-cpp-internal-v0.14.1)
(2026-07-24)


### Bug Fixes

* Redact anonymous context attributes in server-side custom events
([#583](#583))
([55f7eaf](55f7eaf))
</details>

<details><summary>launchdarkly-cpp-server: 3.13.0</summary>

##
[3.13.0](launchdarkly-cpp-server-v3.12.0...launchdarkly-cpp-server-v3.13.0)
(2026-07-24)


### Features

* Add C bindings for Big Segments
([#573](#573))
([948878e](948878e))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-internal bumped from 0.14.0 to 0.14.1
</details>

<details><summary>launchdarkly-cpp-server-dynamodb-source:
0.3.0</summary>

##
[0.3.0](launchdarkly-cpp-server-dynamodb-source-v0.2.1...launchdarkly-cpp-server-dynamodb-source-v0.3.0)
(2026-07-24)


### Features

* Add C bindings for DynamoDB Big Segments store
([#579](#579))
([fc6c075](fc6c075))
* Add C bindings for DynamoDB LazyLoad source
([#576](#576))
([65efc69](65efc69))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.12.0 to 3.13.0
</details>

<details><summary>launchdarkly-cpp-server-otel: 0.1.4</summary>

##
[0.1.4](launchdarkly-cpp-server-otel-v0.1.3...launchdarkly-cpp-server-otel-v0.1.4)
(2026-07-24)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.12.0 to 3.13.0
</details>

<details><summary>launchdarkly-cpp-server-redis-source: 2.4.0</summary>

##
[2.4.0](launchdarkly-cpp-server-redis-source-v2.3.1...launchdarkly-cpp-server-redis-source-v2.4.0)
(2026-07-24)


### Features

* Add C bindings for DynamoDB Big Segments store
([#579](#579))
([fc6c075](fc6c075))
* Add C bindings for DynamoDB LazyLoad source
([#576](#576))
([65efc69](65efc69))
* Add C bindings for Redis Big Segments store
([#574](#574))
([52a1898](52a1898))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.12.0 to 3.13.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Mechanical release-only edits; the notable behavioral change
(custom-event redaction) ships via internal 0.14.1 but is not modified
in this PR’s diff.
> 
> **Overview**
> Release Please **version bump** across the C++ monorepo: updates
`.release-please-manifest.json`, `package.json` workspace deps, CMake
`VERSION`, embedded `kVersion` strings, version tests, and **CHANGELOG**
entries for the packages being published.
> 
> **Server SDK 3.13.0** documents **C bindings for Big Segments**
([#573]). **Internal 0.14.1** documents a **privacy fix** that **redacts
anonymous context attributes in server-side custom events** ([#583]).
**DynamoDB source 0.3.0** and **Redis source 2.4.0** document new **C
bindings** for Big Segments stores and DynamoDB LazyLoad; **client
3.11.3** and **otel 0.1.4** are dependency-aligned releases on
**internal 0.14.1** / **server 3.13.0**.
> 
> There is **no application logic in this diff**—only release metadata
reflecting changes already on `main`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
05b4327. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants