2010/7/20 Chad <innocentkiller(a)gmail.com>om>:
That won't work. Wikimedia doesn't use the
text table, so you
can't just query the text table. When calling things like getRevText()
locally, it's actually accessing external storage, not querying
the database.
Wikimedia actually does use the text table, it's just that old_text
contains a URL-like referrer to external storage and old_flags
contains 'external' to indicate this. You would still need to access
the text table on the remote wiki in order to be able to retrieve the
text from ES.
> * Should we cache the DB-retrieved templates with
memcached?
>
No. At Wikimedia, we already cache revision texts in memcached so we
don't have to query ES too much. Caching DB-retrieved templates in
memcached would duplicate this at Wikimedia at least, and generally
not make a great deal of sense even without the duplication.
An advantage
of memcached here is that it is shared by all the WMF
wikis, whereas the transcache table is owned by a wiki for itself.
It's also generally faster, handles its own expiries and allows for a bit
more flexibility in cache times (some things can be cached longer
than others, potentially).
Note that memcached is also segmented by the choice of keys:
wfMemcKey() prefixes the keys it generates with the wiki ID so wikis
don't interfere with each other's keys. To share memcached entries
between wikis, you'd either need to not use wfMemcKey() (bad) or hack
it to optionally replace the wiki ID with something else (better).
Roan Kattouw (Catrope)