4 ms·
As someone who's worked in both stacks, I dislike both ActiveRecord and Hibernate for different reasons. ActiveRecord because it pushes the database layer into
by Tainnor 2y ago
As someone who's worked in both stacks, I dislike both ActiveRecord and Hibernate for different reasons. ActiveRecord because it pushes the database layer into the model layer (and because Rails pushes the model layer into the view, this often leads to N+1 queries) - and Hibernate because it's a mess of optimisations that nobody understands, weird lazy loading behaviour, it saves records in the background when it feels like, has inscrutable transactional behaviour and wants be in charge of your database schema (thankfully you can turn that off). ActiveRecord's saving graces are a decent-ish query API and that it popularised migrations - Hibernate's that it encourages a repository pattern.
As you write, jOOQ and similar are much better approaches. For Ruby, Sequel is a better library than AR for a number of reasons.