Data

Entity Framework Core provider for Apache Kafka: performance

DEV Community: #csharp Mario Mastrodicasa
Data

KEFCore, the Entity Framework Core provider backed by Apache Kafka, gains a richer topic data model, typed serialization and a second in-memory engine. Its author benchmarks both engines against EF Core's InMemory provider and explains where query time actually goes.

Key points

  • Topic payloads now carry property names, positions and CLR types, so data can be read without the original model.
  • Integer keys are written in raw format instead of strings; complex keys and entities use .NET 6 JSON serialization.
  • The `UseCompactedReplicator` property switches storage from Apache Kafka Streams to the KNetCompactedReplicator engine.
  • In the benchmark the InMemory provider stayed fastest, with KNetCompactedReplicator beating the Streams path.
  • The Streams path pays extra startup cost and must deserialize raw JVM bytes before it can build ValueBuffers.
  • A repeated query skips the back-end fetch, leaving only ValueBuffer construction against the local copy.

Why it matters

KEFCore is a one-maintainer open-source provider, and the author is benchmarking his own library, so read the numbers as a map of where time goes, not a verdict. The split between back-end fetch and entity materialization is still the useful part: that is what you can act on when a Kafka-backed store feels slow.

For most .NET teams on SQL Server or PostgreSQL it remains an experiment. Before adopting it, check the new topic payload format against topics written by earlier versions, and decide whether the Streams path — which the author calls poor — is acceptable for you; if not, plan on `UseCompactedReplicator` and its in-memory copy of the data.

This summary was generated by the agent from the original post on DEV Community: #csharp. The full text and all rights belong to its author and publisher. Go to original

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message