datomic

2019-11-26T12:14:52.451600Z

Where do I find the upgrade instructions from solo to production?

marshall 2019-11-26T12:18:40.452100Z

Just choose a production compute stack instead of a solo compute stack. You should be running a split stack first

joshkh 2019-11-26T13:45:30.453100Z

An attribute which is unique by identity allows us to use its value instead of a :db/id to identify an entity within a transaction. If no entity exists with that value then an entity is created, otherwise facts are stored about the existing entity. Do composite tuples work the same way? They are also :db.unique/identity, however they seem to operate more like :db.unique/value in that they throw an exception when the tuple value already exists.

joshkh 2019-11-26T13:50:03.454900Z

Or in other words, can I take advantage of a tuple to update an existing entity? For example, change this player's colour based on the combination of their first and last name:

{:tx-data [{
            ; composite tuple attributes:
            :player/first-name "Jean-Luc"
            :player/last-name  "Picard"
            
            ; some fact to store about the existing entity
            :player/colour     "blue"
            }]}
Edit: the code example throws a Unique conflict exception when transacted a second time

marshall 2019-11-26T14:11:42.456300Z

You can indeed use a composite tuple for identity and upsert. You have to include the tuple itself in the transaction So in your example, if the unique attribute is called :player/first+last, you need to include a value for :player/first+last in your next transaction to get upsert

marshall 2019-11-26T14:11:55.456600Z

@joshkh ^

kelveden 2019-11-26T14:23:53.459100Z

@kelveden has left the channel

joshkh 2019-11-26T14:28:12.461300Z

Thanks @marshall, you just made my day.

👍 1
marshall 2019-11-26T14:32:04.461800Z

FYI, discussed here also: https://forum.datomic.com/t/db-unique-identity-does-not-work-for-tuple-attributes/1072

joshkh 2019-11-26T14:35:03.462100Z

I came across that post a few months ago when I first encountered the same problem, but to be honest I didn't understand the resolution in the comments.

joshkh 2019-11-26T15:32:25.463700Z

i'm attempting to transact a tuple ident and am getting the following exception:

(d/transact (client/get-conn)
            {:tx-data [
                       {:db/ident       :user/first+last
                        :db/valueType   :db.type/tuple
                        :db/tupleAttrs  [:user/first :user/last]
                        :db/cardinality :db.cardinality/one
                        :db/unique      :db.unique/identity}
                       ]})

Unable to resolve entity: :db/tupleAttrs
any ideas? i have no problem transacting it to another database an hour ago.

favila 2019-11-26T15:34:09.464600Z

This db was created with an older (pre-tuple) version of datomic?

joshkh 2019-11-26T15:34:28.464800Z

yes

favila 2019-11-26T15:34:42.465Z

You need to transact these new schema attributes using administer-system

ghadi 2019-11-26T15:34:44.465200Z

If so, you have to run d/administer-system as in the documentation

ghadi 2019-11-26T15:34:50.465400Z

jinx

joshkh 2019-11-26T15:37:53.465900Z

this applies to cloud as well?

joshkh 2019-11-26T15:38:37.466100Z

silly question, of course it does as i'm missing the attributes 😉

joshkh 2019-11-26T15:39:42.466300Z

great, that did the trick. thanks favila and ghadi!

2019-11-26T16:16:42.467200Z

is it technically possible/viable to downgrade the production primary compute group instance type to something cheaper as long as you don't have users?

marshall 2019-11-26T16:17:03.467500Z

the supported instance types are fixed

marshall 2019-11-26T16:17:09.467800Z

you can, however, reduce your ASG size to 1

marshall 2019-11-26T16:17:15.468100Z

if you don’t need HA

2019-11-26T16:17:20.468300Z

i can see that

2019-11-26T16:17:47.468700Z

reducing asg size

2019-11-26T16:17:50.469100Z

thanks

2019-11-26T16:18:06.469600Z

still, its a factor ten price difference at least

marshall 2019-11-26T16:18:44.470200Z

from solo - prod?

2019-11-26T16:18:47.470300Z

yes

marshall 2019-11-26T16:19:08.470900Z

fair enough; we are definitely taking feedabck and considering options

marshall 2019-11-26T16:19:27.471700Z

also, you can ‘turn off’ the system over nights/weekends if it’s not a user-facing prod system

marshall 2019-11-26T16:19:32.472100Z

same technique - ASG to 0

2019-11-26T16:19:34.472300Z

as long as my customer is not live, I will have difficulty explaining this price to him

marshall 2019-11-26T16:19:47.472800Z

we’re also looking into tooling that will make that somewhat easier to do/manage

2019-11-26T16:20:06.473200Z

simultaneously, I need the architecture at some point, to develop against prod. only features like http-direct

2019-11-26T16:20:19.473500Z

or have staging/test query group separation

2019-11-26T16:21:15.473900Z

i need the platform running for 1-5 users testing on the customer site

2019-11-26T16:21:24.474100Z

turn off is no option

favila 2019-11-26T17:36:05.475Z

Are there plans to expose point-in-time queries via datomic analytics?

dlopes 2019-11-26T20:24:21.475800Z

@darleilopes has joined the channel

cjmurphy 2019-11-26T06:45:36.450300Z

When I create entities I always give them an attribute called :base/type , which is just a keyword, for instance :bank-account . I'd like to find all the entities (preferably that I've created) that don't have this attribute. I've asked this on Stack Overflow: https://stackoverflow.com/questions/58866423/find-all-entities-that-are-missing-a-particular-attribute, but no answers...

benoit 2019-11-26T12:19:08.452300Z

@cjmurphy you would have to somehow reduce the number of entities to check otherwise you're doing a full db scan. So I would write first the clause to identify all the entities you've created and then from those, find all the entities without this attribute.

benoit 2019-11-26T12:20:09.452500Z

Unfortunately it is not explained in the missing? section of the docs and all examples just happend to have clauses before the missing? predicate that makes the query work (`[?artist :artist/name ?name]`)

cjmurphy 2019-11-26T20:01:27.475200Z

Thanks @me1740 that brings things together for me. I can work with knowing the name of an attribute in the entity that may not have a :base/type.

cjmurphy 2019-11-26T20:01:36.475400Z

[:find [?entities ...]
       :in $ :where
       [?entities ::rule/splits ?s]
       [(missing? $ ?entities :base/type)]]