“传统智慧”如何? Mnesia 中实施的概念?引用完整性、复制、高容量

发布于 2025-01-03 03:53:23 字数 459 浏览 4 评论 0原文

我想学习一门函数式语言,Mnesia 似乎是“杀手级应用”,足以让我学习 Erlang。我想先澄清一些概念。

Mnesia 如何在关系上强制执行参照完整性?旧文章说它在数据级别上没有强制执行。现在改了吗?或者 Erlang 和 Mnesia 是否提供了允许我们编写可证明正确且可维护的代码来维护引用完整性的功能?即使是跨 n 个表的传递关系?

查询语言是否支持缺乏全文的即席查询

那么高容量分布式系统呢?文件大小有 4GB 限制,对吗?如何将 10(或更多)百万行写入数据库?并且它会自动将自己分发到其他节点,从而变得高可用吗?这与碎片化有关。我想知道这是否是我每天都要担心的一个操作概念。

它是否可以轻松配置以实现跨物理位置的复制,就像 MySQL 主从设置一样?

I want to learn a functional language and Mnesia seems "killer app" enough for me to learn Erlang. I want some concepts clarified first.

How does Mnesia enforce referential integrity on relations? Old articles say that it is not enforced at the data level. Is it changed now? Or does Erlang and Mnesia provide features that allows us to write provably correct and maintainable code for maintaining referential integrity? Even for transitive relations across n tables?

Does the query language support ad-hoc queries, short of full-text?

What about high-capacity distributed systems? There is a 4GB file limit, right? How can I write 10 (or more) million rows to the database? And will it automatically distribute itself to other nodes, so that it becomes high-availability? This has got to do with fragmentation; I want to know if it is an operational concept I have to worry about everyday.

Can it easily configure so that it does replication across physical locations, like a MySQL master-slave setup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凹づ凸ル 2025-01-10 03:53:23

有几个问题:

  1. 参照完整性 - 不,mnesia 不保持跨表的参照完整性。 Mnesia 仅是 k/v 存储,但甚至可以跨表提供原子事务。因此,您必须自己保持引用完整性,但 mnesia 可以帮助您将事务编写为函数,并启用嵌套事务。 Mnesia 将表和索引之间的引用完整性保持在最大值;-)
  2. 即席查询 - 不,它不适用于 mnesia,但 qlc 模块可以帮助您完成此任务。
  3. 全文 - 不,没有任何开箱即用的支持。 Mnesia 使用应用程序语言 (Erlang) 编写事务的能力可以帮助您,但您必须制定自己的解决方案。
  4. 高容量——有碎片表来处理更大的数据量。
  5. 高可用性——表副本对此提供支持。 (还支持表片段的副本。)
  6. 主从 - mnesia 支持开箱即用的主主复制。如果您需要主从复制,您必须在事务日志的支持下推出自己的解决方案。 (参见mnesia:subscribe/1Mnesia 事件处理。)

it is several questions:

  1. Referential integrity - no, mnesia doesn't keep referential integrity across tables. Mnesia is k/v storage only but provides you atomic transactions even across tables. So you have to keep referential integrity yourself but mnesia helps you with ability to write transaction as functions and enables also nested transactions. Mnesia keeps referential integrity between table and index at max ;-)
  2. Ad-hoc queries - no, it is not work for mnesia but qlc module helps you with this task.
  3. Full-text - no there is not any support for this out of the box. Mnesia ability to write transactions in application language (Erlang) helps you with it but you have to make your own solution.
  4. High-capacity - there are fragmented tables to address bigger data volumes.
  5. High-availability - there is support for this by table replica. (There is also support for replica of table fragments.)
  6. Master-slave - mnesia supports master-master replication out of the box. If you need master-slave replication you have to roll your own solutions with support of transaction log . (See mnesia:subscribe/1 and Mnesia Event Handling.)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文