Mnesia 的桌子位于哪里?
我尝试将 Mnesia 与更传统的数据库进行比较。
据我了解,Mnesia 中的表可以位于(参见 Mnesia 中的内存消耗 ):
ram_copies
- 表存储在ets
中,因此没有 ACID 中的持久性。disc_copies
- 表位于ets
和dets
中,因此表不能大于可用内存?如果表有碎片,数据库不能大于可用内存吗?disc_only_copies
- 表位于dets
,因此内存中没有缓存并且性能较差。并且表的大小受限于dets
的大小,否则表必须被分段。
因此,如果我想要从 RAM 读取的性能和写入磁盘的持久性,那么与 MySQL 或 PostgreSQL 等传统 RDBMS 相比,表的大小非常有限。
我知道 Mnesia 并不是要取代传统的 RDBMS,但它可以用作大型 RDBMS 还是我必须寻找另一个数据库?
我将使用的服务器是内存量有限的 VPS,大约 512MB,但我想要良好的数据库性能。
disc_copies
和 Mnesia 中的其他类型的表格是否如我所理解的那样受到限制?数据库不能部分存储在内存中,完整副本存储在光盘上吗?
I try to compare Mnesia with more traditional databases.
As I understand it tables in Mnesia can be located to (see Memory consumption in Mnesia):
ram_copies
- tables are stored inets
, so no durability as in ACID.disc_copies
- tables are located toets
anddets
, so the table can not be bigger than the available memory? And if the table are fragmented, the database can not be bigger than the available memory?disc_only_copies
- tables are locateddets
, so no caching in memory and worse performance. And the size of the table are limited to the size ofdets
or the table has to be fragmented.
So if I want the performance of doing reads from RAM and the durability of writes to disc, then the size of the tables are very limited compared to a traditional RDBMS like MySQL or PostgreSQL.
I know that Mnesia aren't meant to replace traditional RDBMS:s, but can it be used as a big RDBMS or do I have to look for another database?
The server I will use is a VPS with limited amount of memory, around 512MB, but I want good database performance.
Are disc_copies
and the other types of tables in Mnesia so limited as I have understood? Can´t the database be partially on memory and a full copy on disc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mnesia 数据库对于不同类型表的存储容量已在之前的 SO 问题中讨论过:
Mnesia 数据库的存储容量是多少?
已经有一个很好的答案了。
显然(但我想你已经看过了)官方文档位于:
http ://www.erlang.org/doc/man/mnesia.html
另外,阅读 Mnesia常见问题解答:
最后,Mnesia 表可能是碎片化的。 此处和那里。
这些是我的2p。
The storage capacity of the Mnesia database for the different types of tables has been discussed in this previous SO question:
What is the storage capacity of a Mnesia database?
where a great answer is already available.
Obviously (but I guess you've already seen it) the official doc is available at:
http://www.erlang.org/doc/man/mnesia.html
Also, reading from the Mnesia FAQ:
Finally, Mnesia tables can be fragmented. This is discussed here and there.
These are my 2p.