web applications - Is Eventual consistency incompatible with user authentication process? -


i practice ddd in project.

let's assume boundedcontext identityandaccesscontext , meetingcontext.

both contexts deal following terms:

  • identityandaccesscontext has notion of user class.
  • meetingcontext has notion of participant class. (let's forget creator example).

participant represents user in meeting bounded context.

first, user has created, leading usercreatedevent.
then, in order apply eventual consistency between bounded contexts, message stored in identityandaccesscontext , sent helps event listener , message queuing (still in iac context) meetingcontext, in order create automatically corresponding participant.

it sounds ddd design (imo), come across issue webapp's workflow:

  • user registering through registration form , he's redirected home page.
  • the home page needs participant values...and that's issue:
    the process of eventual consistency might not finish before redirection home page, leading "no values".

how deal case?
making user wait before notification of consistency? bad ux no?
inserting participant values in same transaction of user? ... violating bounded contexts concept, wouldn't it?

what recommend design ui eventual consistency in mind. let's owe isp $10. go online banking site , perform eft. log onto isp account page payment not reflect. in scenario sounds silly expect money reflect immediately. eventual consistency expected , chances either click 'refresh' button till funds reflect or wait day or 2 transaction reflect since expectation.

i don't think should ever try create interactive system using messaging since asynchronous nature no real deterministic outcome w.r.t. timing. however, track registration process in 'source' bounded context and, therefore, know message has been sent , report such on, say, participant page; like: 'your participation request in process'.

then using either form of polling or server-based push technology update participation page once participant object ready.

it sound overly simplistic still think 1 should aim design uncertainty in mind.

hope helps.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -