This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-15
Channels
- # aleph (5)
- # bangalore-clj (1)
- # beginners (53)
- # boot (1)
- # cljs-dev (327)
- # cljsrn (3)
- # clojure (16)
- # clojure-filipino (47)
- # clojure-nlp (4)
- # clojure-russia (1)
- # clojure-spec (3)
- # clojurescript (64)
- # core-async (6)
- # datomic (25)
- # hoplon (5)
- # jobs (5)
- # klipse (2)
- # lein-figwheel (2)
- # lumo (27)
- # om (2)
- # onyx (6)
- # parinfer (4)
- # pedestal (1)
- # protorepl (1)
- # re-frame (31)
- # ring-swagger (1)
- # specter (9)
- # unrepl (11)
(d/transact @conn [{:db/ident :foo/bar
;:db/cardinality :db.cardinality/one
:db/valueType :db/ident}])
=> ":db.error/invalid-install-attribute Error: {:db/error :db.error/schema-attribute-missing, :attribute :db/cardinality, :entity #:db{:id 65, :ident :foo/bar, :valueType 10}}",
(d/transact @conn [{:db/ident :foo/bar
:db/cardinality :db.cardinality/one
:db/valueType :db/ident}])
=> ":db.error/invalid-install-attribute Error: {:db/error :db.error/schema-attribute-missing, :attribute :db/cardinality, :entity #:db{:id 65, :ident :foo/bar, :valueType 10}}",
=> ":db.error/not-a-value-type Not a value type: :db/ident",
- How datomic knows that is missing an attribute?
- How datomic knows that :db/ident is not a valueType?
There is some tool like schema
/`spec`?hello all, new to datomic and considering trying to use it as a datastore on a project.
for my specific use case, there’s a set of attributes I’d like to store that might exhaust the 10b datom soft limit relatively quickly. jamming that into another datastore obviously is un-ergonomic
I was looking for some clarification around how db/noHistory
works. it seems from my tests that facts are still accumulated (I’m testing off the memory version of datomic), as opposed to something resembling an update-in-place operation when a new value is transacted for an attribute. is that actually the case?
beyond that, is excision an option if I don’t have a particularly critical retention window? anecdotally, it seems to put tremendous pressure on the db and doesn’t seem like a long-term solution either
appreciate any input or suggestions
@mss I assume you read this bit from the doc: > The purpose of :db/noHistory is to conserve storage, not to make semantic guarantees about removing information. The effect of :db/noHistory happens in the background, and some amount of history may be visible even for attributes with :db/noHistory set to true. ?
seems to suggeset that facts don’t accrete, and only some amount of mostly recent facts are stored. my experience using the mem transactor/storage was that all the facts were retained. wondering whether that’s actually the case in a production setup, and if so if there’s another solution I might be missing
@mss I believe db/noHistory takes effect when recent datoms are compacted into an index segment: it does not change the fact that db values are immutable
@mss if you have too much data for Datomic, I suggest you try and figure out if some of the data could go to a complementary data store (e.g S3 or a KV store)
and I’m leaning away from datomic for that specific set of attrs, just wanted to make sure I wasn’t missing something obvious. still wrapping my head around the tech
We typically have 5% of our data and 95% of our schema in Datomic
@val_waeselynck so datomic is essentially a database of pointers to external storage for you?
I that sense Datomic is an index for your data, and you only store in it attributes that you might want to query/filter upon
@hmaurer no, it is mainly a regular database to me - the use of external storage is marginal, it just happens to cover a lot of bytes. And yes, the external storage is treated immutably
@val_waeselynck what do you use as your external storage? and do you enforce its immutability through permissions? (e.g. if you use S3 there might be a way to make it insert-only with IAM permissions)
S3 with public but secure object names, and no I don't believe so
I want to count find the campaign with the highest number of creatives, this is what I got so far:
(let [db (d/db conn)]
(->> (d/q
'[:find ?campaign (count ?creative)
:where
[?campaign :campaign/id]
[?creative :creative/campaign ?campaign]]
db)
(d/q
'[:find ?campaign (max ?count)
:in $ [[?campaign ?count]]]
db))))
There is no 'max-by' aggregation in Datomic unfortunately