But it has serious downsides[1], which is a valid reason to forego it for applications that you already know will be complex in domain-logic, transaction-boundaries or where distribution and concurrency are crucial features.
Indeed, the tight coupling to the database is a real and felt problem. It makes migrations and deployments hard. And it makes layering your architecture almost impossible. e.g. I'm currently working on a Ruby (not Rails) application following the Hexagonal Architecture. Where ActiveRecord is powering the persistency adapter; away and aside. AR is not happy in that role. And we use hardly any features of AR, so it is overkill and will be fased out soon (we didn't design it this way, we merely moved the AR out of an existing tangled mess into its dedicated layer/adapter; the next logical step is to remove AR entirely).
But it has serious downsides[1], which is a valid reason to forego it for applications that you already know will be complex in domain-logic, transaction-boundaries or where distribution and concurrency are crucial features.
Indeed, the tight coupling to the database is a real and felt problem. It makes migrations and deployments hard. And it makes layering your architecture almost impossible. e.g. I'm currently working on a Ruby (not Rails) application following the Hexagonal Architecture. Where ActiveRecord is powering the persistency adapter; away and aside. AR is not happy in that role. And we use hardly any features of AR, so it is overkill and will be fased out soon (we didn't design it this way, we merely moved the AR out of an existing tangled mess into its dedicated layer/adapter; the next logical step is to remove AR entirely).
[0] https://martinfowler.com/eaaCatalog/activeRecord.html [1] https://en.wikipedia.org/wiki/Active_record_pattern#Criticis...