Welcome Guest, Not a member yet? Register   Sign In
DRM vs Active Records
#1

[eluser]Unknown[/eluser]
Hello, I have a fully functional application in Codeigniter. I am using Active Records. Should I move to DataMapper? What will be the difference? I am interested in speed mostly, would it be any change there?
Thanks
#2

[eluser]WanWizard[/eluser]
There's no do's or don'ts. You can not compare the two.

In the case of AR, you hand-craft your models, create your model methods, and in them access the database using CI's AR command set.
In the case of an ORM, you one have to hand-craft your custom methods, all generic methods to interact with the database are provided by the ORM.

Given the fact that most database interaction is pretty standard, it's my experience that using an ORM allows for much faster development, especially for bigger applications. But YMMV...

In terms of speed, every abstraction layer added will cost you some performance. Direct calls is fasted, then CI queries, then CI AR, then an ORM. You have to balance the cost of hardware (in case you would need a more powerful server) against the savings in development and maintenance of an application during it's livecycle.




Theme © iAndrew 2016 - Forum software by © MyBB