Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Domain Model Caching #23

Open
nkuehn opened this issue Feb 10, 2015 · 1 comment
Open

Domain Model Caching #23

nkuehn opened this issue Feb 10, 2015 · 1 comment
Milestone

Comments

@nkuehn
Copy link
Contributor

nkuehn commented Feb 10, 2015

I would prefer to provide a well-configured Model cache instead of leaving that completely to the "userspace". Providing a cache on HTTP Level was an original Idea, but is not efficient from a performance point of view and is prone to confusion with real HTTP caches on the network level.

Use Case: Categories, User Cart, some custom objects etc.

Wishlist:

  • deserialization from cache faster than the "regular" stuff (probably hard or even not possible)
  • tightly integrated, but not intransparent API
  • separate cache provider than the one for Oauth configurable (domain objects can get too large for apcu, so a slower but bigger external cache makes sense).

Design decisions to be made

  • domain specific defaults for expiration time
  • how to handle references (serialize as children or flatten the stuff and put children and references that have an ID into the cache separately and get them back on deserialization? )
  • format? json_encode / PHP serialize / custom stuff like msgpack? First impression: either we just cache the raw "data" array (as json or whatever is fast and compact) plus a custom class prefix or we use PHP builtin serialization.
  • API / how to integrate tight

finally: does this make sense at all ? Or is this userspace.
PRO: it's easy to mess up stuff in this area if you don't know the structure of the API very exactly. So better do that in the SDK.
CON: too much application logic?

@nkuehn nkuehn added this to the v1.0.0-BACKLOG milestone Feb 10, 2015
@nkuehn
Copy link
Contributor Author

nkuehn commented Feb 10, 2015

Another important Use Case: It's very likely that we will need the product types for typed object mapping, so the types need to be cached somewhere.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant