ETCD vs Redis

356 views
Skip to first unread message

LARABI Walid Islem

unread,
Jun 21, 2022, 2:43:20 AM6/21/22
to etcd-dev
Hello everyone

I have a question about the difference between etcd and redis

tl;dr
I'm creating a custom dynamic reverse proxy that will be a frontend to forward requests to internal resources (to their internal ips). Internal resources (un)register themselves to the proxy dynamically
 Is it better to use Redis or ETCD (or something else) in this case to persist the data (mapping between url/internal resource)? I'm total noob (never used Redis/etcd)

Full version
I'm using Kubernetes with statefulset workload and I'm having a usecase where :

 1- A client makes a request to have a new instance (new pod in my case) The instance (pod) comes, registers its internal IP to the reverse proxy, to be accessible at "http://serviceurl/nodes/21" (using headless services for k8s experts)

 2- The client is redirected to "http://serviceurl/nodes/21" to talk to its instance

 3- Once gone, with a timeout, un-register the instance and destroy the pod For that, I've coded a small reverse proxy that can register/unregister endpoints dynamically.

 But to persist data, I'm wondering what can be the best option between ETCD and Redis (to store a map of integers to internal IP), a key value store like. eg : {21 : 10.254.213.2} 

Thank you in advance

Josh Berkus

unread,
Jun 21, 2022, 12:27:08 PM6/21/22
to LARABI Walid Islem, etcd-dev
On 6/20/22 23:43, LARABI Walid Islem wrote:
>  But to persist data, I'm wondering what can be the best option between
> ETCD and Redis (to store a map of integers to internal IP), a key value
> store like. eg : {21 : 10.254.213.2}

You can use either database for that. In fact, you can pretty much use
*any* database system for that.

The main reason you would use Etcd is because you want consensus-based
high availability of your data.

--
-- Josh Berkus
Kubernetes Community Architect
OSPO, OCTO

Reply all
Reply to author
Forward
0 new messages