3 ms·
This is so much more easily solved by just sending the JSON document of the user in the message to the worker. A database look is not necessary, a transactiona
by kennystone 14y ago
This is so much more easily solved by just sending the JSON document of the user in the message to the worker. A database look is not necessary, a transactional record lookup based on ID is overkill.
- drumdance 14y agoMaybe. We send different messages based on a user's subscription level which is two tables away ( user.account.subscription). I suppose we could dump that into the json object too, but IMO that just adds complexity.
- kennystone 14y agoLooking up state and dealing with race conditions is way more complex than fire and forget, imo.
- pardner 14y agoWe do something similar, but a little simpler. Each object in our database has a short guid. (In our case, the guids have a type-identifier so by inspection we can tell if a guid is for a user, or text message, or whatever.) We pass the guid to the worker.