Dubbo requests multi-module write operations at a time. How to allocate the calling order is reasonable?

problem description

for example, when a user posts an article, the background of the request needs to do two write operations, calling two dubbo services respectively.

  1. first call the article module to insert the article (article service)
  2. also has a need to record the user"s behavior. To insert a behavior, call the user module to insert the user"s behavior (user service).

whether the module calls corresponding to the 1Pol 2 operation are put into the controller layer, or whether the user module is called directly within the article module.
which is the more appropriate order of these two calls?

< hr >

if the call order is determined, is there any way to ensure the ultimate consistency between the article library and the user library data?

Nov.08,2021

this should be the problem of how to maintain the final consistency of the two rpc calls. Maintain an article release flow table locally, record the corresponding operation flow, start a scheduled task to scan, and compensate for retry within a specified time.


what you are talking about is a typical scenario of distributed transactions. There is only one specific solution upstairs, and you can search for related solutions of distributed transactions on the Internet

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d59e-2c37d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d59e-2c37d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?