This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-18
Channels
- # adventofcode (1)
- # bangalore-clj (1)
- # beginners (118)
- # boot (39)
- # cljs-dev (6)
- # cljsrn (1)
- # clojure (62)
- # clojure-mke (1)
- # clojure-nl (6)
- # clojure-russia (51)
- # clojure-spec (8)
- # clojure-uk (9)
- # clojurescript (101)
- # code-reviews (1)
- # cursive (2)
- # datascript (9)
- # datomic (80)
- # emacs (4)
- # hoplon (27)
- # jobs-discuss (1)
- # off-topic (1)
- # om (1)
- # onyx (18)
- # protorepl (2)
- # re-frame (13)
- # reagent (13)
- # rum (9)
- # test-check (23)
The Datomic Free transactor is limited to 2 simultaneous peers and embedded storage and does not support Datomic Clients. <- what embedded storage exactly mean in this case? Is it mean only dev
or everything expect legacy storages
?
the free
storage; literally an H2 database stored alongside the transactor binaries on disk; requiring the transactor be running to connect to the storage. all other storage types require pro starter or pro
> Datomic free configuration - playtime only!! Is it mean it is impossible to use datomic free on Heroku?
So, datomic has an upper limit of 10 billion datoms... is that just for one db? (i.e. once one DB has filled, can you just switch and start using another DB?)
Somebody can share good article or video to understand how to use partitions. It is confuse for me.
@tjtolton i am learning datomic, but i guess you can clear history in DB first to free space. If it is not enough i guess it is limit by each DB separately.
as i understand :db.part/db
and :db.part/tx
i don’t use it manually, but i can use :db.part/user
or install my own partition… ? [:db/add #db/id[:db.part/user] :db/ident :community.orgtype/community]
- what #db/id
doing here? When to use :db.part/user
and when install new one? Never use manually :db.part/db
and :db.part/tx
? So :db.part/tx
is created during transaction… :db.part/db
is defined by schema what mean :db/ident
values :foo/bar
and :foo/baz
are in the same partition because of namespace :foo
?
[[:db/add "foo" :db/ident :green] [:db/add "foo" :db/ident :red]
will be in :db.part/tx
partition? Also :db.part/db
?
or maybe i can think about that in that way… :db.part/tx
is about Tx
value in this table http://docs.datomic.com/entities.html and db.part/db
is about.... about what? about E
?
@tjtolton 10billion datoms is a practical limit based on ram needed by peer. no limitation in the code.
so using two 10bn dbs from a peer would mean needing twice the ram to hold all the roots in memory for both
@kwladyka @tjtolton partitions:
1. db partition. holds partitions themselves, schema, and all db primitives (try eval (seq (d/datoms db :eavt))
on a brand new in memory database!)
2. tx partition. transactions.
3. user partitions. one installed for you. holds your own data, your db functions, your enums. you can make as many as you like.
why make multiple user partitions? it affect the sort order of entity ids. partitions sort together. this means that index segments hold co-partitioned data together. basically, it improves peer cache performance at scale because less index segments need be read to satisfy a given query, because the stuff is packed together in storage.
partitions are expressed in entity ids as the high bits of the Long. the entity’s birthday plus a counter for that transaction make up the low bits.
@kwladyka impossible to use transactor on heroku: no. painful: yes, because ephemerial storage. you’d need to be very good at keeping backups.
@robert-stuttaford thank you for your explanation, unfortunately still i don’t get it in 100% 😞
http://docs.datomic.com/entities.html Tx
is :db.part/tx
?
probably not a small amount, but I want to use the figure to make a point during my demo 😉
@kwladyka partitions describe a numerical range for entity ids to live in
for schema et all, E is an integer for your entities and for transactions, E is a Long Tx is a reference to a transaction E elsewhere in the database
@tjtolton you could always generate a 10bn datom database 🙂
but basically, it’ll be big servers with > 10 gigs of ram i would imagine
@kwladyka you can forget all about partitions, quite honestly. you only need to think about them if you plan to have a BIG database and you can clearly define arbitrary co-queried sections. e.g. a lot of stuff for client A and ditto for client B or what-have-you.
the latest release allows you to use simpler string temporary ids
the actual range values are much bigger than 1000, of course
looking at your question again, @kwladyka; 1. use :db.part/db when installing schema 2. use :db.part/user when adding your own data 3. use :db.part/tx when annotating the transaction you’re processing
ech i don’t get it.... but maybe answer how use it will help me… so… https://www.refheap.com/124290 how should i create this :product/label “enum” values in the right way?
on 3, an example: (d/transact (d/connect …) [{:db/id (d/tempid :db.part/tx) :transacting-user-entity [:user/email “
Why in examples about “enum” values i don’t see :db/isComponent
parameter in schema?
this would put :transacting-user-entity on the transaction entity itself, which allows you to later see who made that change to the database
what is your goal, here? understand when to use them, or have an understanding of what partitions are and do?
if it’s merely use, you could just use the simpler string tempid system
http://blog.datomic.com/2016/11/datomic-update-client-api-unlimited.html has a section on this at the end
i wanted understand what partitions are and do to know how to use… but i see it is too hard for my today so i can satisfy to know how to use it today 🙂
ok. so if you’re using the newest version of datomic, you don’t need to ever declare a partition any more.
honestly, i think you’d be in a great place if you work through the http://docs.datomic.com/tutorial.html
it uses the new simpler system
[:db/add "foo" :db/ident :green]
is using db.part/user in the background
[:db/add "datomic.tx" :db/doc "remove incorrect assertion”]
is using db.part/tx in the background
but this doc use client
library which is in alpha version. In Clojure probably the best is use peer
?
{:db/ident :inv/sku
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one}
is using db.part/db in the backgroundthese are transactions; both the peer and the client lib are identical in this aspect because they all just send stuff to the transactor
the old system had you explicitly declaring temp ids with a partition
[:db/add (d/tempid :db.part/user) :db/ident :green]
[:db/add (d/tempid :db.part/tx) :db/doc "remove incorrect assertion”]
{:db/ident :inv/sku
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one
:db/id (d/tempid :db.part/db)
:db.install/_attribute :db.part/db} ;; schema had extra ceremony!
so there’s the new vs the old
i suggest you just start doing stuff and see how it feels 🙂
https://github.com/clojure-cookbook/clojure-cookbook/tree/master/06_databases 6.10 to 6.15 has stuff for you to follow along with
it’s older though, and uses the older temp id syntax
good luck!
@robert-stuttaford thank you so much for this explanation. Probably information about Datomic from sources about old and new versions made me so confuse.
key to note that both tempid systems still fully applicable
you can learn it all and apply it all. no breaking changes in any of the APIs.
so… if i have enum values for something how should i declare schema? https://www.refheap.com/124293
what is :tx-data from the docs and why the <!!
(<!! (client/transact conn {:tx-data [{:db/doc "hello world"}]}))
<!! Is blocking take from a channel. Look at the core.async docs for more info on thay
:tx-data is a key to a map. The transact function takes a map as an argument and the map needs to contain the transaction data as a value associated with the :tx-data key
👏 👏 👏 👏 👏
https://www.refheap.com/124298 - how do you deal with transform data datomic <-> clojure spec structure?
As good as an explanation can get, thanks @marshall
in this post http://martintrojer.github.io/clojure/2015/06/03/datomic-dos-and-donts
about the DO's and DONT's of datomic, martin troljer says:
> Do your project.clj
chores
>Datomic brings in lots of maven dependencies. Make sure you don’t suffer from clashes, spend time solving the ‘:exclusions puzzle’.
what does he mean by "the exclusions puzzle"?