Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why use etcd?Can I use redis to implement configuration management/service discovery etc.?

Tags:

redis

etcd

I learned etcd for a few hours, but a question suddenly came into me. I found that redis is fully capable of covering functions which etcd owns.Like key/value CRUD && watch, and redis is very simple to use. why people choose etcd instead of redis? why? I googled a few posts, but no post told me the reason.

Thanks!

like image 724
ericxu1983 Avatar asked Oct 16 '22 15:10

ericxu1983


1 Answers

Redis stores data in memory, which makes it very high performance but not very durable. If the redis server dies, it's easy to lose data. Etcd stores data in files on disc, and performs fsync across multiple nodes before resolving to guarantee consistency, which makes it very durable but not very performant.

That's a good trade-off for kubernetes, which is using etcd for cluster state and configuration, not user data. It would not be a good trade-off for something like user session data which you might be using redis for in your app because you need extremely fast response times and can tolerate a bit of data loss or inconsistency.

like image 66
williamcodes Avatar answered Oct 21 '22 08:10

williamcodes