← Back to context

Comment by swe_dima

5 hours ago

many years ago when Hanami was just getting popular I remember doing benchmarks against Rails when it comes to SQL and was unpleasantly surprised when Rails' ActiveRecord ended up being much faster, despite "speed" being advertised as one of the advantages :-(

Hanami's DB layer was completely rewritten for Hanami 2 (based on Rom, and we've since merged teams), so you should try doing these again!

Rom has some other advantages, like not needing a 1-to-1 mapping between tables/columns to models/attributes. For example, you could have a `users` table that maps to Profile and Account structs. Profile could include a `bio` whereas Account version could have the email, ensuring data doesn't leak beyond what's needed. They're two different use-cases for the same data, so should be modeled separately. This also lets you work with DB's where you don't control the schema (owned by other teams or legacy DB's): you can map the data into the structure you need for your app, instead of carrying around irrelevant attributes.