问题标签 [datomic]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
datomic - Questions about Datomic
Quick questions.
1) If I perform a Transaction, when that result of that transaction returns, are all peers updated? Or will the other peers eventually reflect the change of the transaction?
2) How do peers update their state? From what I understand, Peers have direct access to storage, and is their own cache. So when they don't have what you're asking for, I guess they just retrieve it from storage. How do peers know when their information is out of date?
3) How much does the choice of storage/backend matter? Since db's like MySQL and the like were optimized for a server/client relationship, wouldn't it be possible to create a Datomic-optimized storage solution? Or wouldn't it be worth it?
datomic - 所有新的 datomic id 都比以前的大吗?
我正在编写一个在客户端和服务器之间同步数据的应用程序,因此我经常需要检查服务器上的实体是否比客户端上的任何实体更新。
Datomic 是否保证所有新实体的 id 都大于以前存在的实体?在我把它作为我的程序逻辑的重要组成部分之前只需要知道。
clojure - 为什么 Datomic 在迭代时会连续两次产生相同的临时 ID?
这将产生两个不同的 id,这很好:
但类似以下的任何东西(到目前为止我尝试了很多想法)都会产生两次相同的 id,这不是我想要的:
都产生类似的东西
每次通话产生的号码都相同。
我真正想要的是调用根本不产生数字,这样我就可以通过事务添加产生的数据。
有任何想法吗?
为了清楚起见,文档说:“每次调用 tempid 都会产生一个唯一的临时 ID。”
[在@maxthoursie 发表评论后编辑,无论如何repeat
都会遇到这个问题。]
clojure - 对于此模式,在 Datomic 领域中更惯用的选项是什么?
我有一个关于 Datomic 更惯用的模式的问题。
假设我们有实体User
和。Post
Topic
Post
可以属于Topic
和User
其他Post
(回复)。现在,我应该,
a) 创建一个:posts
属性,它只是一个Post
s 列表,并将其注入到每个需要引用多个Post
s 的实体中?
或者
b) 建立更明确的关系,例如 aPost
有一个:post/author
属性是对用户的引用,也许还有一个:post/belongs-to
属性可以引用 aTopic
或另一个Post
?
观察:如果我做b,我似乎得到了更多的语义关系。例如,我可以这样做(:post/_author user-entity)
,这比现在更能描述他们的关系商店的性质(因为,a has(:posts user-entity)
是什么意思?那些是s favorited s,authored s,还是什么?)User
:posts
User
Post
Post
b的另一个副作用是我可以在Post
不改变任何其他实体的情况下创建一个新实体。如果我做a,我需要创建Post
并将其插入到 的:posts
属性中User
,需要两个操作而不是一个。
但是,我有一种感觉,a可能是更惯用的方式。例如,如果引用而不是通过属性进行引用:posts
,如果我想这样做,似乎更容易看到属性列表如何随时间变化。User
:posts
Post
User
:post/author
什么会更可取,为什么?
clojure - Clojure:使用 Caribou 框架运行 Datomic
我需要做什么才能使用 Caribou 框架运行 Datomic,用于开发和生产服务器?
换句话说,我怎样才能破解 Caribou 来实现它?
希望这是有道理的!谢谢!
clojure - 如何处理需要在其外部设置的库中的变量?
我在几个项目中使用 Datomic,是时候将所有通用代码移到一个小型实用程序库中了。
一个挑战是处理一个共享数据库uri
,大多数操作都依赖于它,但必须由使用该库的项目设置。我想知道是否有一种行之有效的方法来做到这一点。以下是我考虑过的一些替代方案:
在库中删除
uri
符号并将 uri 作为参数添加到访问数据库的每个函数alter-var-root
在 init 函数中通过 或类似机制对其进行更改将其作为动态变量保存在库中,
*uri*
并覆盖希望小的适配器层中的值,例如(def my-url ...bla ...)
(defn my-fun [args] (with-datomic-uri my-uri (apply library/my-fun args))
uri
像原子一样保存在图书馆里
datomic - 带有冒号前缀的 datomic 属性
有 2 个关于 datomic 属性的查询。1.如果我知道属性名称(字符串),我如何检查该属性是否已经在模式中定义?2. 根据我对 datomic 的实验,我看到 datomic 对待带有冒号前缀和不带有冒号前缀的属性是一样的。即,如果我们创建名为“foo”和“:foo”的属性,它们是一回事。这是真的?这是一个限制吗?
我正在使用带有 groovy 的 datomic。下面是用于创建属性的代码。除了名称之外,还输入了其他参数。
我用来验证属性存在的查询是
如果我用“foo”作为属性名和“attributeFor”方法“:foo”作为属性名调用“createAttribute”,我会得到一个结果。即 "foo" 和 ":foo" 被视为相同。如何创建和查询名称中包含冒号前缀的属性?
database - 我什么时候应该使用 Datomic?
我对数据库服务 Datomic 很感兴趣,但我不确定它是否符合我从事的项目的需求。Datomic 什么时候是一个好的选择,什么时候应该避免它?