oliveiragahenrique

oliveiragahenrique

Klife Protocol - Kafka protocol library using message definitions

Klife Protocol

link: GitHub - oliveigah/klife_protocol: Elixir implementation of the kafka protocol

I’m thrilled to share that I’ve just completed the initial version of the docs for Klife Protocol. While it’s still early days, I believe the available features could be useful for someone building something with Kafka, so I wanted to share it here with the community.

Klife Protocol already supports all messages and versions currently available with solid performance for most use cases.

My hope is to release a version of Klife Protocol on Hex soon, and I’d love to hear any feedback or suggestions that the community may have. Thanks for your interest. :smile:

What is the library about?

Klife Protocol is a library that simplifies the serialization work required for communication with Kafka brokers. It’s important to note that Klife Protocol is not a full Kafka client and is not intended to be used directly in application code. Instead, it’s meant to be used as a component inside a full Kafka client.

Motivation of the library

The motivation behind Klife Protocol was to gain a deeper understanding of Kafka and its inner workings. About a year ago, I decided to explore Kafka and the best way to do that was to build my own client.

However, as development progressed and complexity emerged, I decided to implement the protocol first, as it would provide a better understanding under the hood.

Implementing the protocol also allowed me to use some features, such as tagged fields and compact serialization, which as far as I can tell are not available in other Kafka serialization libraries for the BEAM. This implementation of the protocol will evolve over time, and I plan to use it in a future Kafka client called Klife.

Additionally, the separation of the client and protocol provides benefits to other clients that may want to use this implementation of the Kafka protocol independently.

Motivation of this post

I’m posting this here in order to gather any feedback of anyone that may be intereseted in this problem (that is not only about kafka).

Throughout the development process, various challenges have arisen, and I have done my best to overcome them. However, I am aware that there is always room for improvement, and I believe that feedback from the community can greatly assist in this regard. Some areas I would like to highlight:

  • Binary manipulation performance
  • API ergonomy and design
  • Documentation
  • Open source in general

I am open to feedback on any aspect of the project, and I mentioned those areas because they have been the most challenging for me recently, and that’s why they are fresh in my mind.

Closing thoughts

Thank you for taking the time to read through this. I hope that this library can be of use to the community in some way. I am eager to hear any feedback you may have. :purple_heart:

First Post!

jakeprem

jakeprem

Very cool! It’s been several years since I worked with Kafka but I recall running into some difficulties with the Elixir libraries available at the time.

Where Next?

Popular in Announcing Top

sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42842 311
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29305 241
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 13673 119
New
kip
ex_cldr provides localisation and internationalisation support based upon the data from the Unicode CLDR project. Unicode released CLDR ...
407 12799 120
New
kip
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir. I...
622 18393 194
New
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
benlime
LiveMotion enables high performance animations declared on the server and run on the client. As a follow up to my previous thread A libr...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10140 141
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42842 311
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52238 488
New
nobody
Hi! In PHP: $SERVER['SERVERADDR'] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New

We're in Beta

About us Mission Statement