内存中的关系数据库? [英] Relational DB in-memory?

查看:69
本文介绍了内存中的关系数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 Redis 的简单问题.如果其性能的关键在于它在内存中,那么在常规 SQL 数据库上就不能做到这一点吗?

I have a simpleton question on Redis. If the key to it's performance is that it's in-memory, whey can't that be done on a regular SQL db?

推荐答案

任何 DBMS 都可以在内存中"运行.考虑使用 ramdisk.然而,大多数 DBMS(那些使用 SQL 的)并非设计完全在内存中运行,而是大量努力来最小化磁盘 IO 和分页:DBMS 非常努力地保持相关数据"热点(在内存和缓存中)——IO 慢,慢慢.

Any DBMS can be run "in memory". Consider the use of a ramdisk. However, most DBMSs (those with SQL) are not designed to run entirely in memory and put alot of effort to minimize disk IO and paging: a DBMS works very hard to keep the "relevant data" hot (in memory and in cache) -- IO is slow, slow slow.

这是因为数据库数据通常[并且在历史上一直]远大于主存.那和主内存是易失性的:-) [ACID DBMS 使用预写日志记录——到非易失性存储——和其他技术来确保数据永远不会被破坏,即使在意外关闭的情况下也能做很多工作.]

This is because database data is often [and has historically been] significantly larger than main memory. That and main-memory is volatile :-) [ACID DBMSs do lots of works with write-ahead logging -- to a non-volatile store -- and other techniques to ensure data is never corrupted, even in case of a unexpected shutdown.]

一些数据库,比如 SQLite,对磁盘和内存存储使用相同的格式,即使它们明确支持内存存储.对其他 [in-memory] ​​后端的支持和内存使用调整因提供商而异.

Some databases, like SQLite use the same format for the disk and memory stores even though they explicitly support an in-memory store. Support for other [in-memory] back-ends and memory usage tuning vary by provider.

快乐编码.

这篇关于内存中的关系数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆