Syver Enstad wrote:
Gerhard H?ring <gh at ghaering.de> writes:
On a more serious note, Why do you think caching should be
implemented in the application layer (is this the same as the
domain/business layer) rather than the database access layer?
Gerhard H?ring <gh at ghaering.de> writes:
In my opinion, this sort of caching should really be done in the
application layer, not in the database access layer.
I didn't know that PHP programmers used layers at all :-)application layer, not in the database access layer.
On a more serious note, Why do you think caching should be
implemented in the application layer (is this the same as the
domain/business layer) rather than the database access layer?
It's mostly gut feeling about what's the right approach, which has
served me well quite often :-)
If I needed to state reasons, I'd say that the business layer can assure
data consistency, while with this simplistic approach, the database
layer (*) cannot.
-- Gerhard
(*) "database access layer" may sound like something important, but in
my projects, it's only a thin layer on top of DB-API/ADO.NET/... that
provides shortcuts for the most common use cases and allows switching
database backends more easily.