dele (@delv05) header
dele (@delv05) profile picture
Ho Chi Minh, Vietnam
Joined April 2021
I see abstract AI agent architectures everywhere. But no one explains how to build them in practice. Here's a practical guide to doing it with n8n: 🧵
45
335
9
2,370
328,448
If you’ve ever used consumer groups in production at any non-trivial scale, you probably know all the problems with it: - ⛔️ Group-wide synchronization barrier acts as a cap on scalability A single misbehaving consumer can disturb the whole group. Even if you have cooperative rebalancing and static membership enabled, you will still have rebalances happen. 🤷‍♂️ It’s a fact of life I've heard - death, taxes & consumer group rebalances... Even with cooperative rebalancing (which helped a lot!), you’re bound to wait for the slowest member of the group to complete the rebalance(s). 🐌 The problem? No consumer can commit offsets while a rebalance is in progress.❌ Another subtle thing is that with cooperative rebalancing, a rebalance will take LONGER than usual. Why? Because consumers are allowed to process partitions during rebalances. They will call the poll() method more infrequently -- they're busy processing records after all. Thus, the overall rebalance time will increase. This makes it pretty hard to scale to 1000s of members. - 🤯 Complexity The current protocol is pretty complex and hard to understand. It's used for a bunch of stuff, including metadata propagation in Kafka Streams. This complexity results in more: - 🐛 Bugs The harder to reason about and the more moving parts you have - the greater the chance for bugs. There have been quite a few in the protocol. And due to the fact that a lot of the protocol’s logic lives on the clients, that results in...: - 🐌 slow fixes Bugs require client-side fixes, which are slow to be adopted. If you run a Kafka ops team, you know how hard it is to get all of your clients' teams to upgrade! If you're using a cloud service, you need to wait for a new Kafka release to go out. Can't have the cloud provider handle it for you behind the scenes! And if you run a cloud service (me), you need to wait for both a Kafka release to go out and all of your customers to adopt it. 💀 - 🔍 hard to debug Debugging is harder because you need client logs. In the cloud, that's hard to do again. On-prem, debugging requires collecting a lot of log files from different clients and reading through them all. - ⚙️ very extendable You'd think extendability is a good thing... but everything needs to be in moderation! There’s a reusable embedded protocol within the rebalance protocol, where clients are free to attach raw bytes that only they can then parse themselves. It's challenging to build compatible software for this cross-client protocol, as well as near-impossible to inspect from the broker side. - 😢 inconsistent metadata Clients are responsible for triggering rebalances based on the metadata, but different clients can have different views of the metadata. - 😵‍💫 interoperability Different implementations of the clients (i.e. anything besides the Java client) may have bugs. The complex logic needs to be re-implemented quite a few times. This usually means more bugs and a slower time to ship features to your favorite client. A combination nobody likes. ... So what should an open-source community do? KIP-848. A complete re-design of the consumer group protocol: • Logic: Client Side -> Broker • Rebalance Disruption: Stop the World -> Incremental • Protocol: Generic -> Consumer • Model: Pull-Based -> Push Based More info coming to a certain 2-minute newsletter near you...
2
9
82
11,449
What are the common load-balancing algorithms? The diagram below shows 6 common algorithms. 🔹 Static Algorithms 1. Round robin The client requests are sent to different service instances in sequential order. The services are usually required to be stateless. 2. Sticky round-robin This is an improvement of the round-robin algorithm. If Alice’s first request goes to service A, the following requests go to service A as well. 3. Weighted round-robin The admin can specify the weight for each service. The ones with a higher weight handle more requests than others. 4. Hash This algorithm applies a hash function on the incoming requests’ IP or URL. The requests are routed to relevant instances based on the hash function result. 🔹 Dynamic Algorithms 5. Least connections A new request is sent to the service instance with the least concurrent connections. 6. Least response time A new request is sent to the service instance with the fastest response time. Over to you: 1). Which algorithm is most popular? 2). We can use other attributes for hashing algorithms. For example, HTTP header, request type, client type, etc. What attributes have you used? — Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): bit.ly/42Ex9oZ
13
251
2
995
111,516
Replying to @dvorahfr
I grew up in a lower, transitioning to upper, middle income situation, but did not have a happy childhood. Haven’t inherited anything ever from anyone, nor has anyone given me a large financial gift. My father created a small electrical/mechanical engineering company that was successful for 20 to 30 years, but it fell on hard times. He has been essentially bankrupt for about 25 years, requiring financial support from my brother and me. That said, he does deserve credit for teaching me the fundamentals of physics, engineering and construction, which is more valuable than money, but did not support me financially after high school in any meaningful way. Our condition of providing him financial support was that he not engage in bad behavior. Unfortunately, he nonetheless did. There are young children involved, so we continued to provide financial support for their well-being. Regarding the so-called “emerald mine”, there is no objective evidence whatsoever that this mine ever existed. He told me that he owned a share in a mine in Zambia, and I believed him for a while, but nobody has ever seen the mine, nor are there any records of its existence. If this mine was real, he would not require financial support from my brother and me.
11,525
20,110
2,640
216,207
26,371,837
"Two services must not share a data source." This is a hard rule in microservices. But people confuse "sharing a data source" with "sharing data." "sharing a data source" Vs. "sharing data." and a solution.
26
92
1
424
91,966
Most projects are not large enough for Microservices.
27
62
4
494
46,591
another way to test application with dynamodb. docs.aws.amazon.com/amazondy…
1
1
11
System design is the most challenging and exciting type of tech interview. Here is a complete list of topics that will help you get ready: {0/18} ↓
230
1,227
40
5,955
NEW POST: for his third multi-phase protocol @unmeshjoshi now turns to two-phase commit, explaining its many complexities martinfowler.com/articles/pa…
2
26
91
Them: Light theme or dark theme? Us: Why not both?
390
285
43
4,925
Here's my secret to keeping commits small: I don't let them get too big. If they seem like they might grow, I find a good stopping point and commit.
5
11
1
66
Haha. Been there, done that too. What about you? reddit.com/r/ProgrammerHumor…
34
1,085
127
3,338