The-Inevitable-Event-Centric-Book icon indicating copy to clipboard operation
The-Inevitable-Event-Centric-Book copied to clipboard

Exercise: A Unique Random Access Code

Open ylorph opened this issue 4 years ago • 1 comments

You must assign a unique access code in a (pseudo) random fashion. The range of access code at your disposal is [1 000 000, 1 999 999] The access code will be used to give you access to the system at a certain day Once an access code is used , it can not be reused for 6 months. An assigned access code, giving access in the future, may be revoked at any time. It is foreseen that up to 1 000 access codes will be used per day.

Solve this in an Event Sourced fashion. Bonus point if the assignment of the access code does not suffer from Eventual Consistency

ylorph avatar Apr 16 '20 19:04 ylorph

https://github.com/johnbywater/es-example-random-access-codes

johnbywater avatar Apr 18 '20 12:04 johnbywater