问题描述
etcd 可以用作可靠的数据库替代品吗?由于它是分布式的并以持久的方式存储键/值对,因此它将是一个很好的替代 nosql 数据库.此外,它有一个很棒的 API.有人可以解释为什么这不是一回事吗?
Can etcd be used as reliable database replacement? Since it is distributed and stores key/value pairs in a persistent way, it would be a great alternative nosql database. In addition, it has a great API. Can someone explain why this is not a thing?
推荐答案
etcd
- etcd 是一种高可用的键值存储,Kubernetes 使用它来持久存储所有它的对象,如部署、pod、服务信息.
- etcd 具有高度的访问控制,它只能在主节点中使用 API 访问.集群中除主节点之外的节点无权访问 etcd 存储.
- etcd is a highly available key-value store which Kubernetes uses for persistent storage of all of its objects like deployment, pod, service information.
- etcd has high access control, that it can be accessed only using API in master node. Nodes in the cluster other than master do not have access to etcd store.
nosql 数据库
目前有超过 255 个 nosql 数据库,大致可以分为 基于键值、基于列、文档基于和基于图的.将 etcd 视为键值存储,让我们看看可用的 nosql 键值数据存储.
There are currently more than than 255 nosql databases, which can be broadly classified into Key-Value based, Column based, Document based and Graph based. Considering etcd as an key-value store, lets see the available nosql key-value data stores.
Redis、memcached 和 memcacheDB 是流行的键值存储.这些是通用分布式内存缓存系统,通常用于通过在内存中缓存数据和对象来加速动态数据库驱动的网站.
Redis, memcached and memcacheDB are popular key-value stores. These are general-purpose distributed memory caching system often used to speed up dynamic database-driven websites by caching data and objects in memory.
为什么 etcd 不是替代品
etcd 不能存储在内存(ram)中,只能持久化在磁盘存储中,而 redis 可以缓存在 ram 中,也可以持久化在磁盘中.
etcd cannot be stored in memory(ram) they can only be persisted in disk storage, whereas redis can be cached in ram and can also be persisted in disk.
etcd 没有各种数据类型.它仅用于存储 kubernetes 对象.但是 redis 和其他键值存储具有数据类型的灵活性.
etcd does not have various data types. It is made to store only kubernetes objects. But redis and other key-value stores have data-type flexibility.
etcd 只保证高可用性,但不提供快速查询和索引.所有 nosql 键值存储都是为了快速查询和搜索而构建的.
etcd guarantees only high availabilty, but does not give you the fast querying and indexing. All the nosql key-value stores are built with the goal of fast querying and searching.
虽然很明显 etcd 不能作为 nosql 数据库的替代品,但我认为上面的解释将证明它不是一个合适的替代品.
Eventhough it is obvious that etcd cannot be used as an alternative nosql database, I think the above explanation will prove it cannot be an suitable alternative.
这篇关于使用 etcd 作为主存储/数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!