Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Maybe. 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.


Looking up state and dealing with race conditions is way more complex than fire and forget, imo.


We 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: