This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-19
Channels
- # announcements (5)
- # beginners (40)
- # cider (3)
- # clara (9)
- # cljs-dev (2)
- # cljsrn (4)
- # clojure (8)
- # clojure-spec (24)
- # clojure-uk (4)
- # clojurescript (3)
- # cursive (6)
- # data-science (3)
- # datomic (53)
- # emacs (3)
- # figwheel-main (11)
- # fulcro (37)
- # lein-figwheel (17)
- # off-topic (13)
- # parinfer (1)
- # re-frame (9)
- # reagent (2)
- # remote-jobs (7)
- # shadow-cljs (75)
- # tools-deps (4)
- # yada (16)
G'day from down under. Seems like Datomic Cloud is coming to Sydney - should make a big difference to latency for Australian users. https://docs.datomic.com/cloud/releases.html#409-8407
I didn't think this was possible because Sydney doesn't seem to provide AWS Auto Scaling based on this page: https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/
I don't know what datomic uses, but auto scaling groups are part of ec2, not the auto scaling service, afaik.
Right, perhaps I'm reading the marketplace details wrong. here's what it says:
Required AWS Services: APPLICATIONAUTOSCALING, AUTOSCALING, CLOUDFORMATION, CODEDEPLOY, DYNAMODB, EC2, EFS, ELASTICLOADBALANCINGV2, IAM, LAMBDA, LOGS, ROUTE53, S3
Amazon EC2 Auto Scaling has moved You have several options for scaling with AWS. Do you only need to manage Amazon EC2 instances?
I can see ap-southeast-2 in the RegionMap of the compute templates but Sydney isn't a region I can pick on the AWS Marketplace page for Datomic - wondered if that was related or just an issue of getting marketplace updates approved by Amazon.
@U055DUUFS you should be able to use ap-southeast-2 with the 409-8407 release. I will check into what is happening on the marketplace page.
Thanks @U072WS7PE. Look forward to trying it out.
@U055DUUFS Where were you not seeing Ap-southeast-2? I checked on marketplace and was able to see the region when I had 409 selectedâŚ
Sounds like I got punked by "estimating your costs" here https://aws.amazon.com/marketplace/pp/prodview-otb76awcrb7aa
Works like a charm.
Hi! What would be an idiomatic way to query last asserted datom? My idea is to add :created-at
and use max
on it. does this sound reasonable?
hi @U06B8J0AJ, pull is a convenience over query, you can always do what you want with a query.
This gets asked a lot, it may be worth it to add pull-many
just to spare confusion.
I see, thank you. I figured I could probably create my own pull-many
, but I saw it in an example and went looking for it.
I guess if for nothing else, for backwards compatibility with existing guides that may be out there, it might be good to have it in.
@vladex I havenât had to do this personally, but you should be able easily drive this from the datomic log apis. If you do something like -> (tx-range {:start <some num> :end nil}) (last) (look at datoms asserted by tx)
that should get you what you need
@eoliphant do you think that this approach is more performant assuming that I have an index for :created-at
? `
@vladex you said âlast asserted datomâ, thatâs impossible with a created-at attr because it can only be asserted on entities not datoms. Can you be more precise about what you are trying to do?
yeah, you are right đ. Hypothetically, I use datomic for newborns registry at a hospital. I assert an entity with :name
and :born-at
. What is the most idiomatic way to answer what was the name of the last newborn?
ah ok.. Thatâs clearer. So you want the âdomainâ most recent time, not the âsystemâ time when the transaction took place. There may be a more idiomatic approach, but right off the top of my head, you can just do a :find (max ?ba) :where [ .. :born-at ?ba] ...
then use that value to query for the entity you want
yeah, that was my initial idea. âMy idea is to add :created-at
and use max
on itâ. Should be more clear next time đ
but anyway seems strange, with SQL semantics is like ORDER BY LIMIT 1
⌠maybe I should look also into raw indexesâŚ
If you want to be really efficient, you should store the reverse index of what you want
Datomic doesnât have efficient reverse walking of its indexes, so even if you use raw indexes you will have to do some array bisection to find the last value
but I see this pattern quite often: latest news, most recent posts, most liked comments⌠is datomic a good fit in this case? Or should I use third party indexing tools?
Not a good fit for a naive implementation, which is why itâs even a bit difficult to express succinctly in datalog
Thereâs lots you can do short of an external index, but if you canât afford an index scan you do need to do something
Eg you could make a derived attr that orders more naturally; you could cache your âtop xâ list; you could read the Tx queue and keep the âtop xâ values incrementally in memory; you could write a bisection algorithm that uses index-scan to find the latest values without a full scan
Maybe someone can offer advice on modelling permissions in Datomic? I have a Permission entity that represents how any one entity can interact with another. It's essentially an edge with some data stored on it (source, target, access level). Works just fine, but a little hard to manage when either its source or target ref is retracted. The Permission entity still hangs around. I don't think I can solve this with components - that would require every "type" of entity to have a component reference to some Permission entity. Is there something tricky I can do during the retraction of some entity to also retract any related Permission entities?
Could you not write a transaction fn that looks at every transaction (via :tx-report-queue
or by registering a fn in Cloud) and when seeing a retraction, does a query to see if any Permissions reference the retracted thing, then does some cleanup?
Does Datomic Cloud support DB functions yet?
I donât guarantee that this would be uh, performant but you could try it and see if it works well enough
Ah, I haven't looked into registering transaction functions in Cloud (which is where I'm operating).
I havenât done it in anger yet - Iâm still in the âhey letâs get this existing infrastructure to scale successfully before we rewrite all our code to be Cloud-awareâ phase of life - but I know youâre supposed to be able to do so
might be purely Ions, I havenât really looked at the Cloud client at all tbh
I am the living embodiment of that Squidward âfuuuuuuutuuuuuurrrreeeeâ .gif about Datomic Cloud
I only care about the stuff you can just barely trick it into doing, things that are âsupportedâ? Meh!