mozilla / mentat

UNMAINTAINED A persistent, relational store inspired by Datomic and DataScript.
https://mozilla.github.io/mentat/
Apache License 2.0
1.65k stars 115 forks source link

Implement a Firefox-like awesome bar library #698

Open ncalexan opened 6 years ago

ncalexan commented 6 years ago

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.

ncalexan commented 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?

rnewman commented 6 years ago

There's a worked example in the Worked Examples doc, actually!

There are some observations that I think are worth calling out:

rnewman commented 6 years ago

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.

Vimeo.pdf

rnewman commented 6 years ago

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.

grigoryk commented 6 years ago

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:

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 ...

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_media_activity: visitRef, when, stoppedVideoAt visit_reader_activity: visitRef, when, stoppedReadingAt

grigoryk commented 6 years ago

Started pushing some stuff into https://github.com/grigoryk/fenix_profile