This is the initial prototype for the updated UKWA website.
ukwa / crawl-db Goto Github PK
View Code? Open in Web Editor NEWA standalone database for crawl events.
License: Apache License 2.0
A standalone database for crawl events.
License: Apache License 2.0
The Parquet version is proving quite useful. But the schema could use a few tweaks to make it even more useful/speedy.
The current schema looks like this (where the types are defined as Parquet Logical Types:
┌──────────────────────────┬─────────────┬─────────┬─────────┬─────────┬─────────┐
│ column_name │ column_type │ null │ key │ default │ extra │
│ varchar │ varchar │ varchar │ varchar │ varchar │ varchar │
├──────────────────────────┼─────────────┼─────────┼─────────┼─────────┼─────────┤
│ id │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ url │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ host │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ domain │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ ip │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ timestamp │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ status_code │ BIGINT │ YES │ NULL │ NULL │ NULL │
│ content_type │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ content_length │ BIGINT │ YES │ NULL │ NULL │ NULL │
│ hop_path │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ annotations │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ content_digest │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ via │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ start_time_plus_duration │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ seed │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ start_time │ TIMESTAMP │ YES │ NULL │ NULL │ NULL │
│ duration │ BIGINT │ YES │ NULL │ NULL │ NULL │
│ warc_type │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ warc_filename │ VARCHAR │ YES │ NULL │ NULL │ NULL │
│ warc_offset │ BIGINT │ YES │ NULL │ NULL │ NULL │
│ warc_length │ BIGINT │ YES │ NULL │ NULL │ NULL │
│ wire_bytes │ BIGINT │ YES │ NULL │ NULL │ NULL │
├──────────────────────────┴─────────────┴─────────┴─────────┴─────────┴─────────┤
│ 22 rows 6 columns │
└────────────────────────────────────────────────────────────────────────────────┘
Of these:
id
is 'timestamp_14/url` so seems a bit pointless to store, as it could be regenerated easily.ip
as a binary IPv4
value?timestamp
as an actual TIMESTAMP to avoid the slow-down of having to parse it. Maybe add timestamp_14
to store the timestamp as a Wayback-style 14-digit string?annotations
as a LIST[STRING]
embedded type.content_digest
in binary?start_time_plus_duration
?xRelated questions:
From Common Crawl, the columns are:
url_surtkey: Canonical form of URL with host name reversed
url: URL that was archived
url_host_name: The host name
url_host_tld: The TLD (e.g. au)
url_host_2nd_last_part, … url_host_5th_last_part: The parts of the host name separated by .
url_host_registry_suffix: e.g. .com.au
url_host_private_domain
url_protocol: e.g. https
url_port: The port accesed, it seems to be blank for default ports (80 for http, 443 for https).
url_path: The path of the URL (everything from the first / to the query parameter starting at ?)
url_query: Query parameter; everything after the ?
fetch_time: When the page was retrieved
fetch_status: The HTTP status of the request (e.g. 200 is OK)
content_digest: A digest to uniquely identify the content
content_mime_type: The type of content in the header
content_mime_detected: The type of content detected
content_charset: The characterset of the data (e.g. UTF-8)
content_languages: Languages declared of the content
warc_filename: The filename the archived data is in (ANJ: Actually the full file path)
warc_record_offset: The offset in bytes in the archived file where the corresponding data starts
warc_record_length: The length of the archived data in bytes
warc_segment: The segment the data is archived in; this is part of the filename (ANJ: path)
crawl: The id of the crawl (e.g. CC-MAIN-YYYY-WW where YYYY is the year and WW is the ISO week of the year).
subset: Is this the ‘warc’, or ‘robotstxt’, or ‘crawldiagnostics’
*I've found the Parquet documentation very difficult to pin down in terms of how sorted data can be used as an index. It seems the system does support using one column as a sorted index, making binary search possible. Presumably, we could aim to support URL lookup in this way, via a primary SURT column, and this is probably what CC are doing with url_surtkey
as the first column. But it's a bit difficult to work out how to ensure fastparquet
does this and I don't know how to look at a Parquet file and tell the chunks are indexed.
Building on the shared kevals library, add hooks to pull data from Kafka or local files and push to a crawl log database.
For crawl streams from Kafka, some field mapping is required to map Heritrix's fields to the warcprox ones:
size > wire_bytes
mimetype > content_type
seed > source
Also:
annotations
and extra_info
need mapping to string arrayswarc_writer
field needs to be added to mark files as from heritrix3
or warcprox
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.