hypersync-lancedb-pipe
A serverless embedded streaming OLAP data pipeline that leverages historical blockchain data from Hypersync and mutable columnar storage format lance.
Since Lance is designed to be mutable, it is possible to create an embedded streaming pipeline using the same data source. The main advantage of this streaming approach is that it doesn't require any parquet glob file management. This reduces the complexity of streaming to the same as batch processing. The other main benefit is that LanceDB has tight integration with both polars and duckdb. LanceDB accepts polars dataframes as data inputs, which allows for a more flexible ETL pipeline, allowing polars to be used as a preprocessing tool.
Since LanceDB leverages the Apache Arrow Standard, there is a lot of flexibility to query from ths database - such as querying larger than memory datasets with polars lazyframes and a dataframe API, or using an embedded OLAP engine like duckdb for faster speed and SQL API.
Getting Started
- This repository uses rye to manage dependencies and the virtual environment. To install, refer to this link for instructions here.
- Once rye is installed, run
rye syncto install dependencies and setup the virtual environment, which has a default name of.venv. - Activate the virtual environment with the command
source .venv/bin/activate.
Running the Pipeline
There are some script examples in the scripts folder. These examples demonstrate the versatility of the lancedb writer.
- Run
historical_sync.pyfile to backfill data from a historical block number. Assumes there is no existing table. - Run
head_sync.pyto sync the database to the head of the chain. Assumes existing table exists. - Run
backfill_sync.pyto perform a backfill sync from the earliest block number. Assumes existing table exists.
Metadata
Release files for hypersync-lancedb-pipe 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hypersync_lancedb_pipe-0.1.1.tar.gz | 7.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hypersync_lancedb_pipe-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / hypersync_lancedb_pipe-0.1.1.tar.gz
| Download URL | hypersync_lancedb_pipe-0.1.1.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39d00c88e6b73c246765b5903592da645d6f84ddfef8df26cc03b8194a4f896f
|
|
BLAKE2b-256 checksum How to use checksums |
44bfbbd4396e35e053d714320d6828da2b7a0e906592a88b0521d06d61f2517e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.2
|
Release files / hypersync_lancedb_pipe-0.1.1-py3-none-any.whl
| Download URL | hypersync_lancedb_pipe-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2260e9e898f707cc1796ffb473bafb2e60af2179ed4f5697f01c6758b8ce0b23
|
|
BLAKE2b-256 checksum How to use checksums |
f0f6548d7886062ab9baee141476dcb603a12ba5fe6ff037345c69c9695c2e80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.2
|