4 ms·
I'm surprised that dynamic backend management is based on Redis. This seems very heavyweight. Why not just a simple HTTP API?
by michaelmior 11y ago
I'm surprised that dynamic backend management is based on Redis. This seems very heavyweight. Why not just a simple HTTP API?
- jerf 11y agoWhile I'm sure someone, somewhere in the world has it, it would be an odd use case where the "heavyweightness" of the run-time configuration interface actually matters to anyone. And, well, actually, if I had to bet, I'd bet Redis is actually lighter weight than an HTTP request, honestly. HTTP is really quite inefficient for small requests, and requires a massive pile of code to deal with endless, endless corner cases than an application-specific protocol doesn't.
- 15155 11y ago> I'd bet Redis is actually lighter weight than an HTTP request It is. Here's a cool, non-relevant example of one implementing a Redis clone in Haskell (on HN a month or so ago): https://honza.ca/2015/09/building-a-redis-clone-in-haskell https://honza.ca/2015/09/building-a-redis-clone-in-haskell The relevant portion is where they parse the protocol, not bad at all (especially compared to HTTP)
- derefr 11y agoI wouldn't compare Redis pub/sub on a persistent Redis socket to straight HTTP requests; it's more like an HTTP Server-Sent-Event stream, which looks pretty similar at the protocol level.
- nicolaslem 11y agoRedis in Pub/Sub is quite lightweight in fact. It's just a TCP connection between your application and the Redis database. Once opened, you can get notifications almost for free. I was thinking on adding a separate HTTP API to control the load balancer that would read and write to Redis, notifying the load balancer when changes should be applied.
- dave_ops 11y agoBut it's a SPoF and an extra remote or local service that has to be configured, maintained, etc. The thing that's coming online has to publish a message to redis anyway, so why not just maintain the service map inside the Rust application and open up a socket that allows those things to speak straight to Nucleon for mutating its configuration?
- michaelmior 11y agoThat's more what I was getting at, not "heavyweight" in the sense that I see it as a performance concern.
- michaelmior 11y agoThat's more what I was getting at, not "heavyweight" in the sense that I see it as a performance concern.
- halayli 11y agoWhat happens if your connection to redis dropped and a pub was made in between?
- jedisct1 11y agoWhat not NATS instead? There's even a very nice Rust client library for NATS :)