These are chat archives for damianh/Cedar

24th
Jul 2015
Dan Barua
@danbarua
Jul 24 2015 08:10
no just an in-mem one
(this for migrating from NEventStore -> Cedar.EventStore)
managed to get them all imported yesterday
now swapped my EventStoreRepository for a CedarRepository
now onto projection subscriptions
I'm going to have to have a think about how to do competing consumers with a pull-subscription
or whether competing consumers is a dumb idea
or just chuck events on RabbitMQ asynchronously as we currently are with NEventStore (the path of least resistance)
Damian Hickey
@damianh
Jul 24 2015 09:36
-1 for competing consumers on domain events
Dan Barua
@danbarua
Jul 24 2015 09:37
but it's ok
Damian Hickey
@damianh
Jul 24 2015 09:37
Domain event streams are left-fold, order, and application thereof is important
Dan Barua
@danbarua
Jul 24 2015 09:37
just move all your concurrency issues to the read model :trollface:
Damian Hickey
@damianh
Jul 24 2015 09:37
other events types, dm
Dan Barua
@danbarua
Jul 24 2015 09:37
so i need one projection host/manager/whatever running at any one time
then a standby process to take over if the other one dies
so the complexity goes into my infrastructure
Damian Hickey
@damianh
Jul 24 2015 09:38
Or just a parallel projections?
Dan Barua
@danbarua
Jul 24 2015 09:38
yeah this is just for projections
Damian Hickey
@damianh
Jul 24 2015 09:38
Have them both running
but not competing
i.e. duplicate read models
Dan Barua
@danbarua
Jul 24 2015 09:38
interesting
i had considered going down that route
a/b blue/green read models
i'll be having at think about it today
if i get to 4.30pm with no solution i'll just chuck the events on rabbitmq as we currently are and clean up the mess later :trollface:
Damian Hickey
@damianh
Jul 24 2015 09:40
seat-of-the-pants stuff :)
Dan Barua
@danbarua
Jul 24 2015 09:40
yeah
Damian Hickey
@damianh
Jul 24 2015 09:40
a/b blue/green read models
Dan Barua
@danbarua
Jul 24 2015 09:40
basically a hand-rolled NEventStore asynchronous commit dispatcher is plan B
Damian Hickey
@damianh
Jul 24 2015 09:40
yeah that is normal
Adam Ralph
@adamralph
Jul 24 2015 12:38
we went down the duplicate read models in my old job. It works, but there are some gotchas
Damian Hickey
@damianh
Jul 24 2015 12:38
Were you load balancing across them?
Adam Ralph
@adamralph
Jul 24 2015 12:39
yeah :grin:
I think we had that conversation in an airport once :stuck_out_tongue:
the way our load balancing worked was always mysterious (hidden behind layers of red tape) but it seemed "mostly" sticky, so we didn't really many problems with old-new-old-new repeated queries (not that the read models were ever much out of sync during normal operations)
the other thing was that they used timestamps for etags - a really horrible decision. We had something on our backlog to use a SHA of the object serialization or something instead but never got round to it before I left
mind you, I think they used the timestamps of the events, so when in sync I think they matched
although in a high throughput scenario it ran the risk of the serialization of the timestamps losing the required accuracy to distinguish between versions
messy
Damian Hickey
@damianh
Jul 24 2015 12:44
ha yeah I think we did :)
yeah sticky is a mitigation approach, though I'd prefer round-robin balancing if possible.
timestamp for etag :thumbsdown:
Adam Ralph
@adamralph
Jul 24 2015 12:46
do you think a SHA of the serialized object makes sense? never got a chance to try it...
Damian Hickey
@damianh
Jul 24 2015 12:47
if you calc the SHA while projecting and storing it
collections are a bit trickier though.
single document based results can use the source AR version
Adam Ralph
@adamralph
Jul 24 2015 12:48
I would calc and store the SHA as part of the projection, yes
what about documents that are affected by multiple AR's?
Damian Hickey
@damianh
Jul 24 2015 12:48
wouldn't want to be forced into loading the full collection in-mem before getting the sha, but
you need it before flushing the headers
been chewing on that scenario... the doc itself has it's own version perhaps
I think multiple etags are allowed too
Adam Ralph
@adamralph
Jul 24 2015 12:50
they are
yeah, versioning the doc itself, guess that could work
Damian Hickey
@damianh
Jul 24 2015 12:50
things get interesting with sql views / ravendb indexes though.
Adam Ralph
@adamralph
Jul 24 2015 12:51
ravendb :cold_sweat:
not my cup of tea :-)
Damian Hickey
@damianh
Jul 24 2015 12:52
the embedd-ability is the attractive thing though
we can "deploy" it without our customers knowning or caring.
But it's not without it's probs.
If only I could embed postgres....
or zero install xcopy deploy it
Adam Ralph
@adamralph
Jul 24 2015 13:15
we have the same problem with some of our products
using it for the embeddability, but it continues to radiate problems
Dan Barua
@danbarua
Jul 24 2015 13:17
the postgres installer takes 2 mins and everything's configurable from cmdline flags
the only dep i can remember is a VC++ runtime
we wrap it up in a Wix bundle
in fact, it's the least painful part of our installer :)
Damian Hickey
@damianh
Jul 24 2015 13:19
Reminds me, I need to ask you how are things getting on there @adamralph ;)
@danbarua is there any chance of sharing that WiX thing? :beginner:
Adam Ralph
@adamralph
Jul 24 2015 13:23
@damianh indeed!
Dan Barua
@danbarua
Jul 24 2015 13:55
one sec
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
    <Fragment>
        <util:RegistrySearch Id="REGSEARCH_POSTGRES_INSTALLED"
                             Variable="POSTGRES_INSTALLED"
                             Root="HKLM"
                             Key="SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.3"
                             Result="exists"
                             Win64="yes" />

        <PackageGroup Id="Postgres">
            <!-- by setting Permanent="yes" this means that the bootstrapper won't try to remove it on uninstall...
                 any subsequent installations of postgres will detect that postgres is in place and do an upgrade
                 using the preconfigured data-directory, user, servicename, etc

                 Compressed="yes"
                SourceFile="..\..\..\..\..\..\dependencies\postgresql-9.3.4-3-windows-x64.exe"

            -->
            <ExePackage
                Compressed="yes"
                DisplayName="PostgreSQL Database Server"
                SourceFile="..\..\..\dependencies\postgresql-9.3.5-1-windows-x64.exe"
                DetectCondition="POSTGRES_INSTALLED"
                InstallCommand="--unattendedmodeui none --mode unattended --enable_acledit 1 --prefix &quot;[INSTALLDIR]\PostreSQL\9.3&quot; --datadir &quot;[DATADIR]\Postgres&quot; --superpassword postgres --serverport 5432 --servicename Postgres"
                Permanent="yes"
                Vital="yes"/>
            <!-- 
            HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PostgreSQL 9.3 - see UninstallString
            HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-x64-9.3 - Version, Data Directory
            -->
        </PackageGroup>

    </Fragment>
</Wix>
Damian Hickey
@damianh
Jul 24 2015 14:55
@danbarua lovely thanks!!
Dan Barua
@danbarua
Jul 24 2015 14:56
no prob
we install Postgres + RabbitMq under Program Files\Our Product and put their data under ProgramData\OurProduct
rabbitmq is a bit more fiddly - have to set a load of env vars then shell out to the rabbitmq installer exe
Adam Ralph
@adamralph
Jul 24 2015 15:40
that's interesting
Damian Hickey
@damianh
Jul 24 2015 15:40
the xml-ness? :)
Adam Ralph
@adamralph
Jul 24 2015 15:41
Wix FTW :bowtie:
Dan Barua
@danbarua
Jul 24 2015 15:41
our 2nd-to-last hire enthusiastically volunteered to learn Wix. Now he's the Wix guy, and I'm not. :)
the next person through the door will probably get handed the baton
Adam Ralph
@adamralph
Jul 24 2015 15:41
we had one person like that in my last job
the WiX donkey
Dan Barua
@danbarua
Jul 24 2015 15:42
lmao
the biggest mistake we made was conflating installation with configuration
we've got a wix installer with something like a 20 step wizard
Damian Hickey
@damianh
Jul 24 2015 15:43
lol
Dan Barua
@danbarua
Jul 24 2015 15:43
better to just use wix to get things in place on the system and launch a config tool at the end
Damian Hickey
@damianh
Jul 24 2015 15:43
oh fuck that
yes
Dan Barua
@danbarua
Jul 24 2015 15:43
octopus deploy nails it perfectly
Damian Hickey
@damianh
Jul 24 2015 15:43
wix = files on filesytem and anything else just to get running
i.e . a port number for the http listener
then the real setup kicks in
teamcity does the same
Dan Barua
@danbarua
Jul 24 2015 15:44
i much prefer our 'cloud' stuff to on-prem
Damian Hickey
@damianh
Jul 24 2015 15:44
though it's not wix based prob
Dan Barua
@danbarua
Jul 24 2015 15:44
none of this installation/configuration shite
commit -> deployed
vs release every other month or so
Damian Hickey
@damianh
Jul 24 2015 16:07
:beer: :clock12:
Dan Barua
@danbarua
Jul 24 2015 16:07
not sure whether to hit the gym or the pub :/
Damian Hickey
@damianh
Jul 24 2015 18:34
these are not mutually exclusive options!