Page MenuHomePhabricator

Introduce a ContentStore service to allow certain types of content to not be stored as serialized blobs.
Open, LowPublic

Description

Currently, RevisionStore directly uses a BlobStore to store slot content, calling Content::serialize() to turn a Content object into a blob.

There is no reason to hard code this, however. Some kinds of Content may better be stored in a different way, e.g. using a dedicated SQL schema, or in a column store. To allow this, RevisionStore should not use a BlobStore directly, but rather use a ContentStore, which may or may not be implemented based on a BlobStore.

The ContentStore interface would be very similar to the BlobStore interface, but would take Content objects instead of raw data blobs:

	public function getContent( $contentAddress, $queryFlags = 0 ): Content;

	public function storeContent( Content $content, $hints = [] ): string;

The default implementation would be based on BlobStore, Content::serialize, and ContentHandler::unserializeContent. To allow other storage mechanisms to be applied, a wrapper could be used that delegates to the correct ContentStore based on the content model (when writing) and address prefix (when reading).

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
StalledNone
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
OpenNone
OpenNone
StalledNone
OpenNone
OpenNone
OpenNone

Event Timeline

daniel created this task.Nov 8 2018, 11:45 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 8 2018, 11:45 AM
daniel triaged this task as Low priority.Nov 8 2018, 11:45 AM

Pinging some folks who have in the past expressed interest in this idea: @Fjalapeno @WMDE-leszek @Halfak.

daniel updated the task description. (Show Details)Nov 8 2018, 11:49 AM
daniel updated the task description. (Show Details)
daniel updated the task description. (Show Details)Nov 8 2018, 11:51 AM
Tgr added a subscriber: Tgr.Apr 28 2020, 12:49 PM

It should probably have a mass fetch/store interface too, to avoid the problems every similar service has predictably run into.

It should probably have a mass fetch/store interface too, to avoid the problems every similar service has predictably run into.

True. Though for the blob store, we have so far not encountered a use case for mass write. Batch reads are needed by some maintenance scripts.

daniel updated the task description. (Show Details)Apr 28 2020, 5:52 PM