by codebeaker · 14y ago · 0 comments
It's worth mentioning that Rails doesn't encourage access to the underlying database features - and that stepping outside of the Rails/ActiveRecord results in features which are difficult to test and more difficult to maintain in the face of an ever changing API.
I don't care where the next atomic ID comes from, as long as it comes from a datastore that is fast, and that I can trust.
Can you give a ballpark estimate of your write load? And in any case, a server-side trigger executed on insert could handle the process much closer to the data, with fewer round trips and much greater performance.
> I happened to choose Redis because I'm interested in it technologically and I like the API.
With due respect, you've gotta get over that. I'm all about experimentation, but there's a time to break new ground and a time to use the tools that others have already developed and tested.
> It's worth mentioning that Rails doesn't encourage access to the underlying database features
That may be true, but if you're pushing it near the edge of breaking, it may be time to bite the bullet and move small amounts of logic into the database. It's only very slightly harder to test - the general principals are the same - and I'd dare say far easier to maintain.