Jump to content

Data Platform/Data Lake/Project History

From Wikitech

The Analytics Data Lake (ADL) is a large, analytics-oriented repository of data, both raw and aggregated, about Wikimedia projects (in industry terms, a data lake). It currently includes data on pageviews and a beta set of historical data about editing, including revisions, pages, and users As the Data Lake matures, we will add any and all data that can be safely made public. The infrastructure will support public releases of datasets, out of the box.

Initial Scope

Consolidating Editing Data

Millions of people edit our projects. Information about the knowledge they generate and improve is trapped in hundreds of separate mysql databases and large XML dump files. We will create analytics-friendly schemas and transform this separated data to fit those schemas. HDFS is the best storage solutions for this, so that's what we'll use. We will make the schemas and the data extraction using an append-only style, so actions like deleting pages and supressing usertext can be first class citizens. This will allow us to create redacted streams of data that can be published safely.

It will of course be important to keep this data up to date. To accomplish this we will connect to real-time systems like Event Bus to get the latest data. From time to time, we'll compare to make sure we have no replication gaps.

Hive Tables

When storing to HDFS, we will create well documented, unified tables on top of this data. This will be useful for any batch or really long running queries.

Druid

Druid and any other Online Analytics Processing (OLAP) systems we use will serve this data to internal and maybe external users as well. This data serving layer allows us to run complicated queries that would otherwise consume massive resources in a relational database. If we're able to properly redact and re-load this data on a regular basis, we will be able to open this layer to the public.

Analytics Query Service / Dumps

We will continue and push slices of this data out to the world through our query service (AQS) which currently hosts our Pageview and Unique Devices data. We will also make the most useful forms of this data available in static file dumps. These dumps will contain strictly metadata and shouldn't be confused with the "right to fork"-oriented richer dumps. Those may be easier to generate using this system as well, see below.

Pleasant Side Effects

One potential use of this technology will be to help replace the aging Dumps process. Incremental dumps, more accurately redacted dumps, reliable re-runnable dumps should all be much easier to achieve with the Data Lake, and the data streams that feed into it, than they are with the current set of dumps scripts and manual intervention.

Project Documentation

Architecture

Systems

Various experiences[1] on gathering and computing on full edit data history has shown that it's a bad idea to rebuild a full edit data set on regular basis in opposition to incrementally update it.

In order to get there, two core systems are needed:

  • Historical data extraction system: It extracts historical data from either the mediawiki databases and/or the XML dumps and convert and refine it to the schema used (see below for schema description).
  • Incremental data update system: It handles events flowing through a streaming system and updates an already existing data set by transforming and refining the events into the needed schema.

Once those two systems are built and tested, a date needs to decided upon which the data set will be built, from historical system before D, and from incremental system after D. We also plan to maintain the historical system even if its use is less regular than the incremental one, to ensure new data could be extracted historically in the future.

Stack

The plan is to use Hadoop to both store data and compute the various ETL / refinement steps (cheap, reliable and already in place).

Feeding systems will be MariaDB for historical needs since it contains more and better quality data than xml dumps,and Kafka through EventBus for streaming input data.

Querying systems are planned to be Druid for usual / simple metrics, Hive and/or Spark for complex queries, and possibly the Analytics Query Service to provide metrics externally.

History reconstruction

Some progress has been done and we have a working edit history reconstruction history (still with some caveats, but pretty much functional). The following pages describe each one of the steps of the pipeline and related topics.

Data pipeline

Schemas

Optimizations

Incremental data

Query data in Druid

Pivot sample queries

Dumps

Ongoing Work

EventBus

  • Schema update -- task T134502
  • Mediawiki update to handle schema update -- task T137287
  • New event schema to come after this set of patches

Historical data sourcing

  • Hive schema creation and test using simplewiki and a set of test queries on dump generated data -- task T134793
  • ETL for transforming MediaWiki database data to Hive schema for simplewiki -- task T134790
  • Scalability tests to come after pipeline is built

Details not to Forget

  • At page rename, there sometimes is a new page created which has the renamed page original title and redirects to the renamed page. We have left those on the side for the moment.
  • There are user rename log lines that can't be linked back to an actual user. It could be because of deletions, but we're not sure. We should investigate a bit.

Full Text

  • To measure a lot of important metrics like community backlogs, template use, category graphs, etc., we need to parse and analyze the full revision text of articles.
  • To get this content, we can eitherː
    • Look in dumps (Joseph is working this way now)
    • Get stuff from the databases. Quick reminder on thatː on tin, do
      sql metawiki -h 10.64.16.186
      select blob_text from blobs_cluster24 where blob_id = ...
      . Here you get cluster24 from the link in the text table and that IP from looking up cluster24 on https://noc.wikimedia.org/conf/highlight.php?file=db-eqiad.php.

  1. Two historical big projects are dumps generation and wikistats, and a two new internal projects are DataWarehouse and measuring edit productivity.
  2. For instance is_new_editor, is_new_productive_editor, and is_new_surviving_editor for users and is_productive, is_reverted and is deleted for revisions.