Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Local Data Lakehouse

pfeed is designed for scalability, allowing traders to store massive amounts of data, such as orderbook data and tick data, across multiple asset classes. Imagine being able to store all the data for stocks, futures, and options as a retail trader.

To put this into perspective, the BTC-USDT perpetual contract on Bybit has generated 1 billion+ tick data records from 2020 to the present. This is the scale of data we are dealing with.

To handle this, pfeed stores data in a DuckLake. Whether it’s RAW or CLEANED data, it’s all just Parquet files underneath, so the same data lake can live on your local disk or be moved to cloud object storage (e.g. AWS S3) when needed. This way, you can start small with local storage at no cost and easily scale up to the cloud when your data needs grow. Of course, cloud storage will incur costs, but it is much more cost-effective than storing large volumes of data in cloud databases.


Medallion Architecture

pfeed organizes stored data into three layers, following the Medallion Architecture. Each layer is defined by who produced the data:

LayerTerm in pfeedProduced byDescription
BronzeRAWthe data vendordata stored as-is, without any transformations
SilverCLEANED (default)pfeeddata transformed into pfeed’s standardized format
GoldCURATEDyouCLEANED data further transformed with your own transformations

You choose the layer with data_layer: download() accepts 'RAW' or 'CLEANED', and CLEANED data can be stored as 'CURATED' after applying your own transformations, e.g. .transform(...).load(io, data_layer='CURATED').


ETL vs ELT

ETL and ELT differ in when data is transformed, and therefore in what you keep. In pfeed, this comes down to which Medallion Architecture layer you store downloaded data in.

ETL: store CLEANED data

By default, pfeed transforms the vendor data into its standardized format before storing it. This is ETL.

ELT: store RAW data

With data_layer='RAW', pfeed stores the vendor data as-is. This is ELT: pfeed handles the “E” and the “L”, and the “T” is up to you, whenever you need it. For example: