Answer the question
In order to leave comments, you need to log in
Should I use an extra layer of abstraction through Repositories in Laravel?
Is it worth it to install this package https://github.com/andersao/l5-repository , as I understand it, the repository improves performance because they additionally cache data before fetching and inserting it into the database, it also caches queries, right?
And if Redis is already worth it?
Do I need to install repositories early when the load is zero?
Are there any other reasons for putting them on?
Answer the question
In order to leave comments, you need to log in
And if Redis is already worth it?Depends on what exactly Redis does in your case.
Do I need to install repositories early when the load is zero?There is a golden rule, it sounds like "If it's not broken - don't fix it", why would you complicate the code if everything works anyway?
Are there any other reasons for putting them on?I have never set it, the flight is normal. Even on well-loaded projects. (Are we discussing load here?)
as I understand it, the repository improves performance because they additionally cache data before fetching and inserting it into the databaseIn general, in the description of the package, I see that they give "more flexibility" (according to the author), I have not yet found about "more speed" in the text (maybe I was looking badly). How to cache data before fetching - I can imagine, but how you can cache data before inserting it (or why do it at all?) - it seems vague to me. And by the way, MySQL itself caches the results of queries, at the level of the database itself, or are you talking about some other cache? Or you don't have MySQL?
Using repositories is a good practice, I see no reason not to do them
This package is not at all the repository that everyone thinks about looking at the name. In fact, he repeats Eloquent and is tied to his device. A very dubious thing. And Laravel itself can cache out of the box without left packages.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question