Hacker News new | ask | show | jobs
by iwalz 3528 days ago
Since v3 they're using grpc, which means http/2 - since than, long polling is much more efficient!
1 comments

It still feels like a hack instead doing it properly. You're doing long pool instead what you should do in first place, which is push.

Again, I did not work with etcd yet, but in consul because it's "RESTful" i when you monitor multiple services you need to maintain multiple requests.

Edit: Reading more about http 2's frames and pipelining, looks like it's possible to use it similar way it's done in ZK[1]. If GRPC allows that then I suppose it indeed solves this problem.

[1] having a single long standing connection that's not closed after receiving a response. The request frames could be used to place watches and response frames would send the updates to the client.

etcd use bi-directional streams for watchers. One. TCP connections can maintains multiple streams. No matter what you need to keep at least one connection. ZooKeeper is not an exception.
That's good to hear. Seems like that would work the same way then.