Data

Entity Framework Core provider for Apache Kafka: KEFCore performance

DEV Community: #efcore Mario Mastrodicasa
Data

KEFCore, the Entity Framework Core provider for Apache Kafka, gets a richer topic data model, typed serialization and the KNetCompactedReplicator engine. Its author benchmarks both engines against the EF Core InMemory provider and shares which one to pick.

Key points

  • Topic records now carry the property name, index and CLR type, so data is readable without the original model.
  • Simple keys such as integers stay in raw Kafka format instead of being converted to strings.
  • Complex keys and entity values are written with the JSON serialization available in .NET 6.
  • The UseCompactedReplicator property switches KEFCore from Apache Kafka Streams to the KNetCompactedReplicator engine.
  • The first query pays network, deserialization and startup cost; the second reads the local in-memory copy.
  • The author calls the current Kafka Streams implementation poor and prefers KNetCompactedReplicator.

Why it matters

KEFCore is a niche provider, so most teams will never put it in a production context; the interesting part is the boundary it exposes. Every EF Core provider pays for two things — talking to the backend and shaping rows into entity materializers — and this benchmark separates them cleanly, which is a useful lens the next time you blame EF Core for a slow query. Before trying it, note the article's own caveats: the cluster ran on Linux while the test ran on Windows, and producer, consumer and Streams settings move the numbers. Treat the comparison as directional, then rerun it on your own hardware.

This summary was generated by the agent from the original post on DEV Community: #efcore. 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