PR - Add Delta Lake Backend for Cryptofeed
Add Delta Lake Backend for Cryptofeed
Description
This PR introduces a comprehensive Delta Lake backend for Cryptofeed. It adds the DeltaLakeCallback class and several data-specific subclasses to handle various types of cryptocurrency data. The new backend allows for efficient storage and retrieval of high-frequency trading data using Delta Lake technology.
Key Features and Improvements
- Implemented
DeltaLakeCallbackbase class with configurable options for Delta Lake integration. - Added support for batch processing and flushing of data.
- Implemented data transformation and validation methods to ensure data integrity.
- Added retry mechanism for write operations to improve reliability.
- Implemented table optimization and time travel features.
- Created specific Delta Lake callback classes for different data types (e.g., trades, funding, ticker, open interest, etc.).
- Added logging throughout the code for better debugging and monitoring.
Checklist
- [x] Tested
- [ ] Changelog updated
- [ ] Tests run and pass
- [x] Flake8 run and all errors/warnings resolved
- [ ] Contributors file updated (optional)
Additional Notes
This PR significantly enhances Cryptofeed's capabilities by adding a robust Delta Lake backend. It allows users to store and analyze cryptocurrency market data using Delta Lake's features such as ACID transactions, schema evolution, and time travel.
The implementation includes proper error handling, logging, and configuration options to make it adaptable to various use cases. Each data type (trades, funding, ticker, etc.) has its own specialized class to handle specific schema requirements.
Before merging, we should ensure comprehensive testing of all Delta Lake operations, update the changelog to reflect this major feature addition, and run Flake8 to catch any remaining style issues.
Affected Components
cryptofeed/backends/deltalake.py
Hi @bmoscon,
Thank you very much for the project. I built my backend for delta lake and I would like to ask for a review for PR.
The code is following postgres and kafka backends with support for queued updates.
I have tested with cryptostore project with this backend in test env.
Thank you.
Br,
@tommy-ca thanks for the PR, let me review and give it a try and I'll merge it
@OpenHands please rebase to main, review, comment and update this PR