|
FamDav posted:do your events never span multiple objects? your event payloads should include all relevant information, but not necessarily the entire object. and conflict detection / resolution *is* best handled at the materializer level, because that's where the various event streams get funnelled into a single queue regardless of how out-of-whack their sources are say an app user on a 2G tablet in Madagascar orders a widget. the event payload will be something like [ BUYERID; 11252; ITEMID: 110291; QUANTITY: 1; PRICE: $35 ] but, between the last time he queried product data from the server and the time he submitted the sale (event), somebody at the NYC headquarters: a) changed the product description of widgets b) increased the price of widgets c) decreased the price of widgets d) blocked all sales of widgets. if you want to be thorough and have the time to code it, each of these cases should be handled differently (a) do nothing, as the property isn't relevant to the payload; b) apply the price in the event payload; c) apply the new, lower price and notify the user; d) block the sale and notify the user. or you could keep it simple/naive and just pause the sale because the product has changed, doesn't matter. either way, some code somewhere needs to notice the conflict and act upon it you could require the app to sync its widget product data and handle the conflict before submitting the purchase, which is what i think you're suggesting by 'not letting garbage in your event store' - but you can't assume there won't be further changes after that, short of doing some locking silliness. plus you now have to have conflict resolution code in every client app. or, you can let the event be submitted as-is and have the materializer handle the conflict server-side. the UX of both approaches is basically the same, but the latter is simpler and more robust. having events based on stale data in your event store isn't garbage; it is truthful, in that it represents what the user saw and what decisions he made on that basis.
|
# ? May 6, 2017 23:48 |
|
|
# ? May 10, 2024 15:17 |
|
Lutha Mahtin posted:ty for teaching me a new word everyone will think you're a douche for using it but gently caress the haters, math forever
|
# ? May 7, 2017 00:41 |
|
NihilCredo posted:your event payloads should include all relevant information, but not necessarily the entire object. and conflict detection / resolution *is* best handled at the materializer level, because that's where the various event streams get funnelled into a single queue regardless of how out-of-whack their sources are Disregarding the weirdness of letting an application on an untrusted device send an arbitrary price, here's a concrete version of your story. Its March 3rd and the Nintendo Switch launches. You are hammering refresh when the buy box finally appears, and you click buy it right now. You head off to work happy that you didn't have to head off to Target/Walmart/Gamestop/etc. and chase down one. At lunch you get an e-mail saying sorry! you didn't actually buy a Nintendo Switch after all, you just thought you did. Would you say that this is a reasonable customer experience? quote:if you want to be thorough and have the time to code it, each of these cases should be handled differently (a) do nothing, as the property isn't relevant to the payload; b) apply the price in the event payload; c) apply the new, lower price and notify the user; d) block the sale and notify the user. or you could keep it simple/naive and just pause the sale because the product has changed, doesn't matter. either way, some code somewhere needs to notice the conflict and act upon it why would you ever have the client application do anything like that? your client application should have as minimal functionality as is viable, and leave the rest to all of those servers that are actually under your control. you should never blindly trust any data that is coming to you from a client application, nor should you push that kind of application defining logic to something you can't easily update. so when the app is telling the backend that the customer wants to order something, you have the ability to validate the request before you ever submit it to your event bus. If its an invalid event, you tell the customer right then and there that you are out of stock or that the price has changed, as opposed to minutes/hours later outside of the context of the order. like, there exist event sourced datastores that handle submission of events as transactions in an application-invariant way. i use one every day at work that runs a lot of stuff a lot of people in this thread use. one that is publicly available is datomic http://www.datomic.com/get-datomic.html quote:having events based on stale data in your event store isn't garbage; it is truthful, in that it represents what the user saw and what decisions he made on that basis. all information is out of date the moment it leaves the machine and so your customer (or some other computer) is always making decisions on out of date information. In almost all situations consumers desire and expect transactionality when they perform a mutating operation like ordering a video game console or spinning up some virtual machines, and they (like you should) consider reneging on that promise to be a failure of the system.
|
# ? May 7, 2017 03:19 |
|
tracking causality: it's hard
|
# ? May 7, 2017 03:55 |
|
I wish kinesis had infinite retention
|
# ? May 7, 2017 06:46 |
|
I am a poo poo programmer. Can I just use an event sourcing datastore thing in my project in a idiot proof way like if I wanted to use MySQL/postgres/mongo? Is that diatomic thing it?
|
# ? May 7, 2017 07:25 |
|
floatman posted:I am a poo poo programmer. Can I just use an event sourcing datastore thing in my project in a idiot proof way like if I wanted to use MySQL/postgres/mongo? datomic is the only event-sourcing-ish thing I've seen that comes anywhere close to just working out of the box without having to gently caress with it endlessly. that said, I'd only bother with it if you're working in some language on the jvm. you can work with it from other platforms but they're 1000% second class citizens Arcsech fucked around with this message at 08:25 on May 7, 2017 |
# ? May 7, 2017 08:23 |
|
FamDav posted:Its March 3rd and the Nintendo Switch launches. You are hammering refresh when the buy box finally appears, and you click buy it right now. You head off to work happy that you didn't have to head off to Target/Walmart/Gamestop/etc. and chase down one. At lunch you get an e-mail saying sorry! you didn't actually buy a Nintendo Switch after all, you just thought you did. Would you say that this is a reasonable customer experience? quote:all information is out of date the moment it leaves the machine and so your customer (or some other computer) is always making decisions on out of date information. In almost all situations consumers desire and expect transactionality when they perform a mutating operation like ordering a video game console or spinning up some virtual machines, and they (like you should) consider reneging on that promise to be a failure of the system. i think we're talking about slightly different things when I said "notify the user", I didn't necessarily mean "send a cancellation email later", but that the order confirmation and feedback cannot be any sort of 'pre-validation', it must originate from the event projection processor saying 'yea, sold, keep going' or 'nay, can't sell, reason: $X', because the processor is the only piece of code that is in a position to say so authoritatively. for most use scenarios (certainly for mine) that means just waiting a few seconds for a HTTP response in the same session. but if you work on a much larger scale and the projection is too slow to make the client wait for it - or heck, if you have a random connection timeout - I guess the client should display a "your order is being processed, we'll send you a confirmation email when it's clear" message (which is what I've seen a few e-commerce sites do, although most likely not for any event sourcing-related reasons, but in any case it was a perfectly acceptable UX) because, what is the alternative? quote:so when the app is telling the backend that the customer wants to order something, you have the ability to validate the request before you ever submit it to your event bus. If its an invalid event, you tell the customer right then and there that you are out of stock or that the price has changed, as opposed to minutes/hours later outside of the context of the order. that's great, but how exactly did you determine that his request is invalid, without submitting it to the event bus? you need to figure out what the state of the system is or will be after every single one of the preceding events have been projected. you need to know that there are still Switches in stock and that the price hasn't changed. otherwise you could oversell because another customer sent his sale 3ms earlier than you but it's still in the queue if you don't want to wait for the event projection processor to handle all the events ahead of you in the queue (which is what I'm suggesting), then you have to look at the queue yourself to figure out if the last one got snagged or not. but that's just running the projection in the first place, isn't it?
|
# ? May 7, 2017 11:42 |
|
Lmao event sourcing, or anything else, isn't gonna solve the classic over sell ecommerce problem. It's a business decision to fix, either you try to make sure you absolutely don't sell too many. Then your gonna be slower. Or you just accept the orders and accept a few over sells stopping the sale of the product when you notice and hope you can source additional examples to cover all sales.
|
# ? May 7, 2017 12:47 |
|
floatman posted:I am a poo poo programmer. Can I just use an event sourcing datastore thing in my project in a idiot proof way like if I wanted to use MySQL/postgres/mongo? datomic is great, but it's more than an event sourcing db - it's an immutable database that gives you transaction histories out of the box; you can use it for event sourcing, by designing your facts in an event style, but it's not required (and since you get immutability + transaction history anyway, you could argue that you have less reason to do that). also I'd go further and say that you really want to be speaking clojure to work with datomic if you just want to mess around, i'd suggest downloading eventstore. it's kinda janky and i wouldn't trust it in production, but it has nice APIs (.net or js) and it's explicitly about event sourcing in a way other, tougher products aren't. look up some sample projects too from what i've seen, most real-world event sourcing designs just use whatever no/sql datastore fits best with their stack, architecture, and scale (and bigger ones split the architecture into multiple components, eg distributed messaging system + dumb kv store for events + acid store for aggregates). the legwork really comes in the application code
|
# ? May 7, 2017 13:14 |
|
reading up on java 9 modules and i want them so bad. https://www.slideshare.net/scolebourne/java-se-9-modules-jpms-an-introduction
|
# ? May 7, 2017 16:06 |
|
NihilCredo posted:i think we're talking about slightly different things yeah maybe we're talking past each other? I'm saying that you can perform a transaction to submit to the event bus without the event bus knowing what the whole materialized view looks like. you submit enough data about the transaction, and the service that handles submissions can verify that your transaction viewed a consistent state of the world. your materializers will see the events a few milliseconds later, and will be able to process them in an application invariant way because the only application specific code here was creating the transaction to submit in the first place.
|
# ? May 7, 2017 16:40 |
|
zokie posted:Lmao event sourcing, or anything else, isn't gonna solve the classic over sell ecommerce problem. Yep, you either lock the stock count and then accept the speed cost, or figure out another business process centered way to approach the problem, accepting the reality of the technical limitation.
|
# ? May 7, 2017 16:46 |
|
Maluco Marinero posted:Yep, you either lock the stock count and then accept the speed cost, or figure out another business process centered way to approach the problem, accepting the reality of the technical limitation. what do you actually think the speed cost is here? and why do you think "lock the stock" is the only means to achieving that?
|
# ? May 7, 2017 16:52 |
Condiv posted:reading up on java 9 modules and i want them so bad. owns. im glad that java is my spare time coding activity, i'll be able to hop right in
|
|
# ? May 7, 2017 17:59 |
|
NihilCredo posted:datomic is great, but it's more than an event sourcing db - it's an immutable database that gives you transaction histories out of the box; you can use it for event sourcing, by designing your facts in an event style, but it's not required (and since you get immutability + transaction history anyway, you could argue that you have less reason to do that). also I'd go further and say that you really want to be speaking clojure to work with datomic does datomic still prohibit benchmarking in their license agreement
|
# ? May 7, 2017 18:03 |
|
Condiv posted:reading up on java 9 modules and i want them so bad. Ha ha why would they introduce new "requires," "transitive," and "exports" keywords for the module descriptors, then reuse "static" for optional dependencies, instead of just saying "requires optional"? Good ol' Java.
|
# ? May 7, 2017 18:24 |
|
java 9 modules are neat but they're a big obstacle to supporting our products on java 9 since we went all-in on osgi lmao
|
# ? May 7, 2017 18:47 |
|
https://vimeo.com/216330850
|
# ? May 7, 2017 19:32 |
|
carry on then posted:java 9 modules are neat but they're a big obstacle to supporting our products on java 9 since we went all-in on osgi lmao apparently you can still use osgi on java 9, there's the classpath and the module path now and osgi would still use the classpath i'd think the slides claim you can use osgi with java 9 at least
|
# ? May 7, 2017 21:26 |
|
i hope scala supports jpms in language soon. i'd imagine you could get sbt supporting it and make the module descriptors in src/main/java/fart/clownpenis, but i'd rather it be supported in the scala language
|
# ? May 7, 2017 21:31 |
|
fleshweasel posted:does datomic still prohibit benchmarking in their license agreement yes. although there's no restriction on benching their free version, which runs on h2 (think java sqlite) this is stupid as gently caress but also doesn't mean its slow. it doesn't have a query planner so if you order your clauses wrong you can make a fast query run very slow but all you need to do is make it so your first clause is a restrictive one that is, if you do something like this: code:
code:
|
# ? May 7, 2017 21:53 |
|
FamDav posted:what do you actually think the speed cost is here? and why do you think "lock the stock" is the only means to achieving that? I'd love to hear another way of approaching the problem but at the end of the day surely there must be a single source of truth that must be referred to in order to get that stock count? if multiple requests come in, you must handle each one sequentially at some sort of bottleneck to guarantee there is in fact stock remaining and that it's okay to charge the user. the amount of things that happen inside that bottleneck could move around yes, you could reserve the order, then try payment with the processor, and then unhold the order of it fails, but there is always going to be some sort of single funnel you need to go through the process the sale with an exact stock count.
|
# ? May 7, 2017 22:50 |
|
I kinda want to play around with an event sourcing sort of architecture, and I was wondering if there is anything a lil less heavyweight than Kafka out there
|
# ? May 7, 2017 23:14 |
|
all the IIgs system documentation and examples are in Pascal i don't know Pascal help at least Orca's C compiler and assembler both come with translations of the apple example desktop program into C and assembly
|
# ? May 7, 2017 23:48 |
|
datomic is using a subset of prolog as a db language (called datalog) right?
|
# ? May 7, 2017 23:56 |
|
Pascal is just like C but instead of { and } you have begin and end hope this helps but in all seriousness Pascal as used for systems programming like on the Apple II, III, Lisa, Macintosh, and IIgs is almost exactly equivalent to C, with just slightly different syntax like instead of int *x; you have var x: Integer^; and instead of x = &y; you have x := @y; and instead of z = *x; you have z := x^;, it's almost 1:1 equivalent and you can actually do source-to-source translation from Pascal to C that results in highly readable code, unlike most other languages the biggest differences were actually under the hood: typically Apple's Pascal calling conventions pushed arguments in the opposite order from C's calling conventions, so they added a pascal keyword for function prototypes to indicate this in a declaration of a Toolbox or operating system function there are a couple of other notable syntactic differences that affect how a program reads: Pascal has sets as part of the language where C would typically use bitwise operations on integers, Pascal historically used prefix-counted instead of NUL-terminated strings (e.g. Str31, Str255, which is why Apple C dialects support \p to indicate a string literal is length-prefixed), Pascal had a with construct for simplified record access, and it had a concept of "variant records" that act kind of like a crude inheritance overall though that should be enough to know to be able to read Pascal easily you could also always get Orca/Pascal or TML Pascal… wasn't there an "Apple Programmer's Workshop" too, like MPW but for the IIgs?
|
# ? May 8, 2017 00:00 |
|
Condiv posted:datomic is using a subset of prolog as a db language (called datalog) right? correct
|
# ? May 8, 2017 00:09 |
|
eschaton posted:Pascal is just like C but instead of { and } you have begin and end pascal was the fire language i ever learned. to this day i typo assignments as := if im not paying attention
|
# ? May 8, 2017 00:16 |
|
i like ada and wish i had more reasons to use it i've never programmed pascal, but i hear ada is kinda pascalish. i like its syntax
|
# ? May 8, 2017 00:28 |
|
the Apple Programmer's Workshop was a licensed version of Orca I ordered a compactflash card for the GS anyway since it's a pain to try to run these compilers off floppies, I paid for the ByteWorks software collection (every compiler and tool they made plus PDFs of all the manuals, courses, and documents) so once it gets here I'll be set for Apple action C, Pascal, Modula-2, integer BASIC, 65816 assembly, and shell scripts all in one IDE
|
# ? May 8, 2017 00:33 |
|
my undergrad switched to pascal (from modula-2) my second quarter in the sequence, i remember it as "fine" except arrays of different sizes were different types
|
# ? May 8, 2017 02:09 |
|
cis autodrag posted:pascal was the fire language i ever learned. to this day i typo assignments as := if im not paying attention i kind of like = for equality and := for assignment hosed up but true
|
# ? May 8, 2017 09:06 |
|
St Evan Echoes posted:i kind of like = for equality and := for assignment
|
# ? May 8, 2017 10:47 |
|
St Evan Echoes posted:i kind of like = for equality and := for assignment = is the match operator hth
|
# ? May 8, 2017 10:49 |
|
St Evan Echoes posted:i kind of like = for equality and := for assignment i agree that they need to be different operators anyway. assignment is the more dangerous one, so maybe it should be harder to type none of that for (int i = 0; i = n; i++) bullshit thanks
|
# ? May 8, 2017 12:02 |
|
St Evan Echoes posted:i kind of like = for equality and := for assignment := reminds me of BNF, which makes more sense as an assignment operator than trying to remember which sequence of = means equality and which means assignment.
|
# ? May 8, 2017 14:14 |
|
cis autodrag posted:pascal was the fire language i ever learned. to this day i typo assignments as := if im not paying attention did pascal just die because of that considered harmful essay, because it was the language for a decade plus
|
# ? May 8, 2017 14:14 |
|
pascal is still alive in delphi, inst it? is delphi alive, by the way?
|
# ? May 8, 2017 14:14 |
|
|
# ? May 10, 2024 15:17 |
|
gonadic io posted:none of that for (int i = 0; i = n; i++) bullshit thanks clang gives you warnings on this type of poo poo, you should be using -Werror, and also write them as yoda comparisons
|
# ? May 8, 2017 14:42 |