简体   繁体   English

键值存储作为主数据库

[英]Key-value store as primary database

I am about to start a project where read and writes will be large and frequent, Thereby looking around I found that in-memory databases are made exactly for that purposes itself. 我即将开始一个项目,其中读取和写入将是大而频繁的,因此环顾四周我发现内存数据库完全是为了这个目的而制作的。 Investigating a little more took me to redis. 再调查一下,我就开始了。

Redis seems pretty cool(Just started reading, alot to know about it though). Redis看起来很酷(刚开始阅读,虽然很多人都知道)。 But I have primarily seen only relational databases and think of data in term of tuples and relations (I think this I can learn with time). 但我主要只看到关系数据库,并根据元组和关系来思考数据(我想我可以随着时间学习)。

I have following questions right now: 我现在有以下问题:

  1. Can I use only redis to store my data ? 我可以只使用redis来存储我的数据吗?
    • Reason why I am asking is that every article I have seen use Redis/memcached as an intermediate layer for caching. 我之所以要问的原因是我所看到的每篇文章都使用Redis / memcached作为缓存的中间层。
    • Can I just rely on redis to persist my data through out ? 我可以依靠redis来保存我的数据吗?
  2. Where to host/run redis database ? 在哪里托管/运行redis数据库?
    • Since Redis is an in-memory database, its requirement of host will definitely be different than applications that require more processing. 由于Redis是一个内存数据库,它对主机的要求肯定会与需要更多处理的应用程序不同。 Hosts which have more RAM will definitely be better here. 拥有更多内存的主机肯定会更好。
    • So where do people normally go on to host their database ? 那么人们通常会在哪里主持他们的数据库?
    • Elasticcaching from AWS, can this be used to host redis(as a primary database, not just caching layer) 来自AWS的弹性缓存,可用于托管redis(作为主数据库,而不仅仅是缓存层)
  3. Any resources ? 有资源吗?
    • I always ask this, I found lots of good documents online, but nothing really good to start with. 我经常问这个,我在网上找到了很多好文件,但没什么好开头的。 Please share any good resource if you are aware of. 如果您知道,请分享任何好的资源。

Can I use only redis to store my data ? 我可以只使用redis来存储我的数据吗?

It depends on your requirements but with 150+ NoSQL database available, I suspect redis is not your only option. 这取决于您的要求,但有150+ NoSQL数据库可用,我怀疑redis不是您唯一的选择。

Reason why I am asking is that every article I have seen use Redis/memcached as an intermediate layer for caching. 我之所以要问的原因是我所看到的每篇文章都使用Redis / memcached作为缓存的中间层。

It is faster than JDBC, but do you need it to be faster? 它比JDBC快,但你需要它更快吗?

Can I just rely on redis to persist my data through out ? 我可以依靠redis来保存我的数据吗?

You could, it depends on your reliability requirements. 您可以,这取决于您的可靠性要求。 eg some organisations only trust traditional RDBMS databases. 例如,一些组织只信任传统的RDBMS数据库。 Note: you need to have redis on multiple servers to pretect against a failure. 注意:您需要在多台服务器上安装redis以防止出现故障。

Where to host/run redis database ? 在哪里托管/运行redis数据库?

Wherever you like. 无论你喜欢什么地方。

Since Redis is an in-memory database, its requirement of host will definitely be different than applications that require more processing. 由于Redis是一个内存数据库,它对主机的要求肯定会与需要更多处理的应用程序不同。 Hosts which have more RAM will definitely be better here. 拥有更多内存的主机肯定会更好。

I would normally put a NoSQL instance on the same machine. 我通常会将NoSQL实例放在同一台机器上。 The amount of RAM you give it depends on how much data you need. 您提供的RAM量取决于您需要多少数据。

So where do people normally go on to host their database ? 那么人们通常会在哪里主持他们的数据库?

Across multiple servers for redundacy, they can be shared with the applications. 在多个服务器之间进行冗余,可以与应用程序共享它们。

Elasticcaching from AWS, can this be used to host redis(as a primary database, not just caching layer) Any resources ? 来自AWS的弹性缓存,可用于托管redis(作为主数据库,而不仅仅是缓存层)任何资源?

I would ask them. 我会问他们。

I always ask this, I found lots of good documents online, but nothing really good to start with. 我经常问这个,我在网上找到了很多好文件,但没什么好开头的。 Please share any good resource if you are aware of. 如果您知道,请分享任何好的资源。

There is no one resource as there is no one answer. 没有一个资源,因为没有一个答案。 If there was, there would be 150+ NoSQL databases. 如果有的话,将会有超过150个NoSQL数据库。

Disclaimer: I have work another NoSQL key-value store which is persisted as well as in memory and is dramatically faster (if you need that sort of thing) It is also simpler to use/deploy. 免责声明:我已经开发了另一个NoSQL键值存储,它存储在内存中并且速度更快(如果你需要那种东西)它使用/部署也更简单。 https://github.com/OpenHFT/Chronicle-Map https://github.com/OpenHFT/Chronicle-Map

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM