These are chat archives for RBMHTechnology/eventuate
Global-scale event sourcing and event collaboration with causal consistency
I was going to say to @knoldernarayan that use Conditional Requests but this works only if I write and read (conditional request) to the same endpoint, doesn't? Because timestamps are local to an endpoint?
However, when you ask
how can we properly replay the events so that the OTP for a user is available on any instance.
I think that events are currently being property replicated asynchronously, so you'll never see a global state shared between all the instances (this is the way Eventuate/Causal Consistency works).
OneTimePasswordGeneratedevent that is replicated. When the user wants to login the (replicated) system needs to verify the OTP, for which it needs the
OneTimePasswordGeneratedevent. For this (processing the "VerifyOTP" command) the system would have to use a
ConditionalRequest(timestamp, VerifyOTP(otp))including the vector timestamp from the
OneTimePasswordGeneratedevent. Therefore the user would have not only to provide the OTP but also the vector timestamp. Assuming the system sends a link for the next login to the user (not only the OTP) this link could contain the additionally needed information (everything somehow hashed/encrypted of course). Alternatively (from a technical perspective) the OTP presented to the user could be "$otp:$timestamp" so that both parts that are needed for the verification are available. From a usability perspective this would not be nice because the OTP as presented to the user would be rather long.