Open ncalexan opened 6 years ago
@rnewman this is very vague, but do you want to link to/try to sketch a worked example about places and history data? Other comments?
There's a worked example in the Worked Examples doc, actually!
There are some observations that I think are worth calling out:
moz_places
is a denormalized, mutable rollup of some observed metadata about pages retrieved from the place's URL.f(frequency, recency)
is a very rough approximation.Once we start to break out the concept of a page, it becomes natural to model media. Here's a sketch of how we might do that for the kinds of real-world video metadata present on the web.
I'd recommend starting with similar capabilities to Fennec, but with these normalizations baked in. That will make it trivial to add containers (which is not trivial in Firefox).
The use of materialized views should cut off any performance issues from the normalization in the data model.
In my notes, I was thinking about page
as a url meta
, but otherwise I've largely converged on what Richard outlined above.
For history, something like this might work:
visit
to url
creates an observation about url_meta
. visits
are segmented by context
.context
answers questions such as "when", "where" and "how" visit was performed (time, deviceId, containerId, physical location, etc). Expressing this as part of visit
itself is probably fine.url_meta
describes a url
as observed at a visit
within its context
.page
: url
visit
: page, when, deviceRef, containerRef
url_meta
: visitRef, title, description, etc
This allows our retrieval to trivially query past states (search through url_meta
, associate with a url
). This structure also allows for segmenting our frecency scores (thanks to captured context
).
It also allows us to trivially generate multiple sets of frecency scores (and thus 'top sites') - for a device, for a time of day, for a day of week, etc.
It's compatible with Fennec's history/visits store, and with the sync15 history record model. When syncing this model against sync15 ...
visit
and url_meta
for a page
are rolled up into a history record, a count of visits
is computed, and a visits
json array is generated. url_meta
observation is generated from the current history
record rollup (if different from the latest observation). A number of visit
entries are generated from the visits
json array, as necessary.The two data models are not fully compatible. sync15 doesn't have concepts such as device
, for example. At some point, we're going to have to do something lossy - synthesize information (assume a device), or drop it. E.g. sync.next->sync15, reset sync.next, sync15->sync.next will drop real device info and assume a synthesized defaults. I'm not sure this can be avoided though.
This can be expanded in various ways. E.g.
visit
to a url
, user might generate activity
. A visit
is within a context
and has an associated url_meta
, and so we can segment activity
by any of those.visit_media_activity
: visitRef, when, stoppedVideoAt
visit_reader_activity
: visitRef, when, stoppedReadingAt
context
, and so it's possible to suggest "start reading article X where you left it off on your Android phone" while visiting article X on desktop.Started pushing some stuff into https://github.com/grigoryk/fenix_profile
This ticket tracks implementing a Firefox-like awesome bar library, in Rust, built on top of Mentat. This is pretty open ended. We need to:
This is really about figuring out what functionality we need to support for our browsers, starting with a drop-in for Firefox for Android.
This isn't really a Mentat issue, but I think it makes sense to experiment very close to Mentat while we learn. There's a bunch of different directions this could go: deeply into the product experience, deeply into the details of a future sync, deeply into the performance profile.