Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WIP: [DEVEX-250] Add built-in auto-serialization#323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
oskardudycz wants to merge27 commits intotrunk
base:trunk
Choose a base branch
Loading
fromDEVEX-250-AutoSerialization

Conversation

oskardudycz
Copy link
Contributor

🚧 WIP

Motivation

KurrentDB users should be able to quickly feel efficient in using basic operations like appending new messages, reading them or subscribing to notifications about them. The current API is not fulfilling it as it doesn't provide safe defaults for the most common scenarios like:

  • building the state from events,
  • appending new events as an outcome of the business logic,
  • subscribing to stream etc.

Currently, they need to consider immediately in which order to read the stream, what the deadline is, and what max count to provide. And most importantly, how to serialize data and which serializer to use, as there's none. All of those customisations are needed in the end but shouldn't be thrown immediately on users if they just want to use thedefault recommended way. In most development environments, you can find the default, mature choices for serialization.

Such code may not be complex; once you get it right, you don't need to change it too often. But if it's stacked with multiple other things you need to keep in mind, then it's easy to miss something. Most importantly, we shouldn't require our users to build their own wrappers around KurrentDB, but we should provide an accessible API to benefit users from using KurrentDB from the get-go.

Solution

The code adds automatic serialization of message payloads. It uses JSON as a default but allows users to implement the binary format themselves. Thanks to that, user can:

  • append plain messages ,
  • use a simplifiedMessage wrapper that takes data, and optionally metadata and message-id, this hides the unwanted complexity ofEventData,
  • read messages deserialised automatically. Thanks to that, the user doesn't need to think about which resolved event is correct (event, original event, they can just use Message or DeserializedData fields).
  • subscribe to messages deserialised automatically.

To introduce those capabilities, it was necessary to introduce new methods not to make breaking changes. Having that, I benefited from it and reshaped their APIs.

Now, they just take mandatory data as parameters (e.g. stream name when appending or reading from stream) and pack the rest of the optional parameters into the options parameter. It also wraps safe defaults.

A follow up to changes the .NET Client:this andthat

Note: This PR reopens#308 that was accidentally closed while working on rebrand

w1amand others added27 commitsDecember 16, 2024 13:27
…ptionsClient` and `EventStoreDBProjectionManagementClient`
* refactor: move ExpectedRevision to StreamState.---------Co-authored-by: YoEight <yo.eight@gmail.com>
…o make clearer responsibility on raw and auto-serialized events
…ma Regsitry, naming strategy and related settingns
@oskardudyczoskardudycz changed the base branch fromtrunk toDEVEX-184-Kurrent-RebrandingMay 5, 2025 07:37
@oskardudyczoskardudycz changed the base branch fromDEVEX-184-Kurrent-Rebranding totrunkMay 5, 2025 07:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@oskardudycz@w1am

[8]ページ先頭

©2009-2025 Movatter.jp