key value store

924 views

Kubernetes uses ETCD as a key value store

Why in the first place Kubernetes cluster needs key-value store ? What’s the use case ?

In: Technology

2 Answers

Anonymous 0 Comments

A key/value store is something that stores data as pairs: a name (“key”), and a value. For instance such a store can be used to store configuration. Example:

Key Value
—————————-
Username Alice
Password hello64234
FontSize Small

And so on. They’re generally much simpler than databases, so they get used a lot for all kinds of simple use cases that don’t require something more complex, like a full blown relational database.

So, for instance a list of which machine has which IP address could be stored like that.

Anonymous 0 Comments

Basically, when you write a conventional program, you can store variables and use them later. I can take a user’s name and age, store them in a variable, and use them later on.

In highly available redundant applications, you can’t store “stateful” data in variables. Other instances of the application also need to know this data. Instead, you use a key-value store backend to store this data. That way, any instance of your application that needs this data queries the store and gets it. The data store itself can implement concepts like redundancy and consistency within itself, which isn’t something that every application should have to implement internally.