Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Mao Zedong Thot
Oct 16, 2008



jesus :chloe:

Adbot
ADBOT LOVES YOU

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

fleshweasel posted:

how does event sourcing play with changing schema over time

the event tables hold the payloads in unstructured blobs*, so they don't change beyond maybe adding more metadata columns

for the state tables, you're golden because even if - let's say - you change literally everything about them, worst case you just wipe them, create the new schema, and reprocess all your event tables using your updated code that supports the new schema

usually that ain't gonna be necessary if you're just adding a few new columns or tables to support a new feature, but it's good to have the failsafe available


* this isn't as much of a horror as it sounds, and as I originally thought, because if your application uses the internet at all then chances are you will receive events in the form of an unstructured xml/json blob anyway, so you don't have to do any more de/serializing than you already would

NihilCredo fucked around with this message at 02:48 on May 6, 2017

Arcsech
Aug 5, 2008

"gee, I wonder if there's a way you could automate that process

no, no, that would be too complicated. better just sit here and wallow in my own rancid poo poo" - rob pike

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

:drat:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

oooooh the GS compactflash hard drive card is a clone of a card from the '90s made by the guy who makes all the other apple 2 enhancement hardware

well i got one on the way so go me

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

everything I ever see about go is :tif:

nern
Oct 29, 2005

RIDE RIDIN LIKE THE DEMON INSIDE YOUR DREAMS

Finster Dexter posted:

lmao what does a masters level class in "advanced" javascript even look like?

yeah. it's a new offering. apparently the class just getting you started using a couple of JavaScript frameworks. like angular, and backbone. and one other one I can't think of off the top of my head right now.

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

nern
Oct 29, 2005

RIDE RIDIN LIKE THE DEMON INSIDE YOUR DREAMS

software engineering

Bloody
Mar 3, 2013

Pointsman
Oct 9, 2010

If you see me posting about fitness
ASK ME HOW MY HELLRAISER TRAINING IS GOING

nern posted:

yeah. it's a new offering. apparently the class just getting you started using a couple of JavaScript frameworks. like angular, and backbone. and one other one I can't think of off the top of my head right now.

Scala as hard as you possibly can.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

nern posted:

angular, and backbone.

:yikes:

Potassium Problems
Sep 28, 2001

fleshweasel posted:

how does event sourcing play with changing schema over time

So far pretty good, alter the schema, make changes to the projection code (and/or events if they want to start capturing more data) & move on, but like NihilCredo said it's nice to have the option to burn it all down and rebuild knowing you won't lose any data, unless you torch your event store

NihilCredo posted:

* this isn't as much of a horror as it sounds, and as I originally thought, because if your application uses the internet at all then chances are you will receive events in the form of an unstructured xml/json blob anyway, so you don't have to do any more de/serializing than you already would

this is one of the few times a document database would be a good use case if for whatever reason you wanted to keep your write model completely separate from your read model, but dbo.EventStore is plenty good enough

redleader
Aug 18, 2005

Engage according to operational parameters

AWWNAW
Dec 30, 2008

Potassium Problems posted:

So far pretty good, alter the schema, make changes to the projection code (and/or events if they want to start capturing more data) & move on, but like NihilCredo said it's nice to have the option to burn it all down and rebuild knowing you won't lose any data, unless you torch your event store


this is one of the few times a document database would be a good use case if for whatever reason you wanted to keep your write model completely separate from your read model, but dbo.EventStore is plenty good enough

do you ever have to blow away a projection and start from scratch? or create a new projection from scratch? how do you handle bootstrapping them from the beginning of time?

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

it's really nice that i have a supportive dad who takes an interest in me starting a computer-toucher career. like today he sent me a link for a big nasa bounty initiative

https://www.theverge.com/2017/5/4/15549276/nasa-hpfcc-fun3d-fluid-simulation-fortran-challenge

on the other hand it's hard to explain to him things like "i got a C in calculus" and "i post in this thread"

Shaggar
Apr 26, 2006

lmao. go users are so stupid

Bloody
Mar 3, 2013

Lutha Mahtin posted:

it's really nice that i have a supportive dad who takes an interest in me starting a computer-toucher career. like today he sent me a link for a big nasa bounty initiative

https://www.theverge.com/2017/5/4/15549276/nasa-hpfcc-fun3d-fluid-simulation-fortran-challenge

on the other hand it's hard to explain to him things like "i got a C in calculus" and "i post in this thread"

quote:

The system is used internally at NASA, as well as by companies like Boeing and Lockheed, to develop and optimize new vehicles and engines.

lol yeah lemme just work for boeing and lockheed, for free, in my spare time

Potassium Problems
Sep 28, 2001

AWWNAW posted:

do you ever have to blow away a projection and start from scratch? or create a new projection from scratch? how do you handle bootstrapping them from the beginning of time?

I've never had to blow everything away, but I've had to create new projections, and it's only a little more involved than a schema change. the code involves creating a class the subscribes to the relevant events that creates that projection, then I have an event streamer class that streams events in order from the store (unbuffered dapper query) , with the only subscriber to these events being the new projection class

it's only happened a couple of times and the app isn't traffic heavy so I got away with doing this at the end of the day on my dev box, making sure everything looks right, then pointing it to production. once the prod projection is done I add back all the other event subscribers and deploy the code.

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

Lutha Mahtin posted:

it's really nice that i have a supportive dad who takes an interest in me starting a computer-toucher career. like today he sent me a link for a big nasa bounty initiative

https://www.theverge.com/2017/5/4/15549276/nasa-hpfcc-fun3d-fluid-simulation-fortran-challenge

on the other hand it's hard to explain to him things like "i got a C in calculus" and "i post in this thread"

same but i got a D in calculus

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

potassium problems, how do you keep track of which events have been processed and which ones have not? flag each event, store a "last processed event" value somewhere, or something else?

triple sulk
Sep 17, 2014




holy poo poo

The_Franz
Aug 8, 2003

Bloody posted:

lol yeah lemme just work for boeing and lockheed, for free, in my spare time

lol all of the comments are basically saying the same thing

quote:

I sincerely hope no one wins this. Software used by "companies like Boeing and Lockheed"?
This is contract work that should be paid in full.

quote:

Poor licensing and a small prize.

quote:

That "prize" is missing a half dozen zeroes.
…this that "gig economy" I keep hearing about?

FamDav
Mar 29, 2008
so are your write events derived from state in your state table? if so, what are you doing to deal with stale reads?

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

The_Franz posted:

lol all of the comments are basically saying the same thing
incidentally,

Avenging_Mikon posted:

You don't think geeks would work for NASA for cheap?

LethalGeek posted:

Only saying some people might have enough passion to want to do it anyway. I don't know why that's such a wild idea.

Judge Schnoopy posted:

That prize makes it seem like they're aiming the project at colleges and universities looking to gain prestige. I can see MIT taking a stab with hardly any stakes involved.

They're not really looking for professionals.

KoRMaK posted:

Fortran aint that hard to learn.

Im only 30 and I had to learn it in college when I worked at the steel mill on VAX/VMS machines.

divabot posted:

I'm thinking "starving grad student" here.

22 Eargesplitten posted:

They're probably hoping for people that want a hobby project anyway.

I'm not surprised that they are trying this, given Trump's whole "Get your rear end to Mars" thing that will doubtless come with no budget increase.

Potassium Problems
Sep 28, 2001

NihilCredo posted:

potassium problems, how do you keep track of which events have been processed and which ones have not? flag each event, store a "last processed event" value somewhere, or something else?
I have a "dispatched" bit column in the event store table, but I fully admit I'm probably not doing this part right. I persist the event record, push it to subscribers, and then update the event record setting dispatched to 1. if for whatever reason an exception is thrown by the event handlers, dispatched will be 0 and I get a notification something happened. I'll fix it and using that event streaming class I have, replay all the non-dispatched events for the affected aggregate. you have to make sure your handlers are idempotent for this though, as they might get an event they already processed.

I've only had to do this once, and it was because an external service I was writing to was offline. I was lucky because it didn't effect the aggregate state in a major way and it didn't matter when this event happened in relation to other events, so I could update the handler to just ignore request failures and I have a Hangfire job that tries again later.

Bloody
Mar 3, 2013

anthonypants posted:

incidentally,

this is why the grey forums are bad

Luigi Thirty
Apr 30, 2006

Emergency confection port.

it's relaxing to write bad C in this text based editor

except when my GS runs out of memory trying to juggle compiler, linker, and editor and the OS crashes

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Bloody posted:

this is why the grey forums are bad
friend, it is merely one of the reasons

Potassium Problems
Sep 28, 2001

FamDav posted:

so are your write events derived from state in your state table? if so, what are you doing to deal with stale reads?

yes, and nothing! all the event processing happens in the scope of a web request so stale reads shouldn't happen. probably not best practice, but if stale data was an issue, I would probably get lazy and just show the user a "changes have been made but may take a moment to show up" message

e: you'd probably also make parts of your aggregate idempotent so if a user acts on stale data, the command is just ignored. i.e. ApproveRequestCommand sent twice, the 2nd time the state is already approved so return w/o processing or generating an event for it

Potassium Problems fucked around with this message at 21:31 on May 6, 2017

spiritual bypass
Feb 19, 2008

Grimey Drawer
i just had a python 2 project dropped in my lap at work which is cool bc ive never really used python at work

my first move was to upgrade to python 3 just bc i dont like to use outdated things; hope i didnt break it

GameCube
Nov 21, 2006

you already know python. its just pseudocode

VikingofRock
Aug 24, 2008




Potassium Problems posted:

yes, and nothing! all the event processing happens in the scope of a web request so stale reads shouldn't happen. probably not best practice, but if stale data was an issue, I would probably get lazy and just show the user a "changes have been made but may take a moment to show up" message

e: you'd probably also make parts of your aggregate idempotent so if a user acts on stale data, the command is just ignored. i.e. ApproveRequestCommand sent twice, the 2nd time the state is already approved so return w/o processing or generating an event for it

2to3 takes care of like 99% of upgrading python2 -> python3 issues so hopefully you used that

spiritual bypass
Feb 19, 2008

Grimey Drawer
i basically did whatever pycharm told me to do (jetbrains all products license :c00l:) and it seems to work so far

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!


ty for teaching me a new word :D

FamDav
Mar 29, 2008

Potassium Problems posted:

yes, and nothing! all the event processing happens in the scope of a web request so stale reads shouldn't happen. probably not best practice, but if stale data was an issue, I would probably get lazy and just show the user a "changes have been made but may take a moment to show up" message

e: you'd probably also make parts of your aggregate idempotent so if a user acts on stale data, the command is just ignored. i.e. ApproveRequestCommand sent twice, the 2nd time the state is already approved so return w/o processing or generating an event for it

so you're reading from the state table, submitting the event to your events table, and materializing into your state table within the lifetime of the request? are you taking simultaneous requests?

my concern about stale data wasn't about users seeing out of date data, it was submitting conflicting/incorrect events because you don't have a mechanism to know if anything you read from or are writing to has been modified from when you started reading from your state table to when you submitted to your event table. i dont know all the details of what your event store or your application is doing, tho :/

Potassium Problems
Sep 28, 2001

FamDav posted:

so you're reading from the state table, submitting the event to your events table, and materializing into your state table within the lifetime of the request? are you taking simultaneous requests?

my concern about stale data wasn't about users seeing out of date data, it was submitting conflicting/incorrect events because you don't have a mechanism to know if anything you read from or are writing to has been modified from when you started reading from your state table to when you submitted to your event table. i dont know all the details of what your event store or your application is doing, tho :/

ahh, I haven't run into that, the scope of this app is for internal change requests and multiple people looking at one at the same time is rare let alone updating one, but like I said users acting on invalid data should be covered since your aggregates should be always be hydrated into the most current state no matter how out of date the read model is since the source of their data is the event store, The One Source Of Truth.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

FamDav posted:

my concern about stale data wasn't about users seeing out of date data, it was submitting conflicting/incorrect events because you don't have a mechanism to know if anything you read from or are writing to has been modified from when you started reading from your state table to when you submitted to your event table. i dont know all the details of what your event store or your application is doing, tho :/

this is why your events record the version of the object they were acting on, so if you're subbed and you observe an event on an older version, you can know there's a conflict and decide on how to handle it.

FamDav
Mar 29, 2008

Asymmetrikon posted:

this is why your events record the version of the object they were acting on, so if you're subbed and you observe an event on an older version, you can know there's a conflict and decide on how to handle it.

do your events never span multiple objects?

EDIT: and you're pushing confliction detection/resolution down to your materializer instead of making sure garbage didn't make it into your events in the first place. now youre event store isnt the one source of truth, its the one true source of some data which has to be interpreted by your application specific one true materializer.

FamDav fucked around with this message at 22:49 on May 6, 2017

Adbot
ADBOT LOVES YOU

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
(i've never actually done event sourcing)

you'd have to issue possibly conflicting events through the same source, right? otherwise there's no way possible for them to never have a conflict? do you add that kind of check at that point? like, if i can issue WithdrawMoney commands, I issue them with the version of the object I want to update, and then the thing that maps WithdrawMoney commands to MoneyWithdrawn events decides if my event is allowed.

  • Locked thread