so rails has added another race-condition-having insert API to replace its existing race-condition-having insert API further material for the article I'm working on about how the type { read() -> T, write(T) } cannot possibly provide consistency
I am definitely not advocating that `create_or_find` is a good API. I argued against adding it at the time. For real improvement to happen though, I think Rails needs to:
-
-
- Become more comfortable with APIs that are coupled to a single DB. Upsert in particular is really tricky, and the number of DB agnostic APIs you can build for it are *extremely* limited - Build more APIs focusing on the DB as the source of truth.
-
Users are too used to the app holding state, and then telling the DB, expecting consistency. It's hard to undo that and train folks that it woks by giving the DB a change and then asking it for the state of things
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.