mardi 3 mai 2016

does dynamic laravel database properties affect the application speed?

i'm using Laravel 5.1 in my new application its already at beginning point but i guess in a near future it would be a large app with lots of data and queries may each user asks.

Laravel uses somehow dynamic properties for mysql database fields for example you just say

$role = new Role();
$role->slug = 'admin';

you didn't define anything like

Class Role extends Model{
   protected $_slug;

   public function getSlug(){
       return $this->_slug;
   }
   public function setSlug( $slug ){
       $this->_slug = $slug;
       return $this;
   }
   ...

this ( in old way) so to say slug field is actually exists and i'm using it, you're just assign it dynamically,

my question is does this scheme affects the speed of application in a large scale of data or it doesn't matter ?

should i define each table fields , for better performance or not ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire