Delivery Method Comparison
Choosing the right delivery method is crucial for cost optimization. BlockDB offers three primary pricing models: API (Compute Units) for on-demand queries, WSS (Real Time Delivery) for real-time data streaming, and Archive Delivery (SFTP/S3/etc.) for bulk data exports.When to Use API
The API is optimized for:- Deltas and incremental updates: Fetching only new data since your last sync
- Strictly selected periods: Querying specific time ranges, block numbers, or addresses
- Filtered queries: Retrieving specific subsets of data (e.g., transactions for specific contracts)
- Ad-hoc analysis: One-off queries and exploratory data analysis
API pricing is based on Compute Units (CU) per request. Each request consumes CUs regardless of result size, making it cost-effective for targeted queries. See Compute Units for detailed pricing.
When to Use WSS
The WSS is optimized for:- Real-time data streaming: Low-latency queries for interactive applications
- Event-driven architecture: Subscribing to specific events and streams
- Data streaming: Streaming data to your applications in real time
WSS pricing is subscription-based. Contact [email protected] for WSS pricing details and subscription options.
When to Use Archive Delivery (SFTP/S3/Azure/etc.)
Archive delivery is more economical for:- Broad market views: Getting all ERC-20 tokens across all chains
- Comprehensive historical data: All swaps on all supported DEXes in the previous month
- Full dataset snapshots: Complete historical backfills of entire datasets
- Bulk analytics: Processing large volumes of data for research or reporting
Cost Comparison Examples
Example 1: All ERC-20 Tokens
API Approach:Example 2: All DEX Swaps (Previous Month)
API Approach:Example 3: Recent Transactions for Specific Contract
API Approach:Example 4: Real-Time Price Monitoring
WSS Approach:Hybrid Approach
Most production systems use a combination of Archive Delivery, API, and WSS:- Initial backfill: Use Archive Delivery to load historical data into your warehouse
- Incremental updates: Use API to fetch deltas and new data outside potential chain reorganization windows since last sync
- Real-time streaming: Use WSS for real-time data streaming and event-driven architecture (prepare for potential chain reorganization windows)
The
_tracing_id field is consistent across all delivery methods, allowing you to reconcile records and track lineage regardless of delivery method.Decision Matrix
| Use Case | Recommended Method | Why |
|---|---|---|
| All ERC-20 tokens | Archive Delivery | Broad dataset, fixed cost |
| All swaps on all pools (monthly) | Archive Delivery | Comprehensive historical data |
| Recent transactions for specific contract | API | Targeted query, low CU cost |
| Deltas since last sync | API | Incremental updates, efficient |
| Real-time price monitoring | WSS | Low latency, event-driven, no polling |
| Complete historical backfill | Archive Delivery | Bulk data, economical |
| Ad-hoc exploratory queries | API | Flexible, pay-per-query |
| Event-driven applications | WSS | Real-time streaming, subscriptions |
Getting Started with Archive Delivery
To set up Archive Delivery:- Contact [email protected] to discuss your bulk data needs
- Specify datasets, chains, and time ranges required
- Choose delivery method: SFTP, S3, Azure Blob, Snowflake Share, etc.
- Receive scheduled snapshots or one-time exports
See Also
- Compute Units - API pricing model
- Archive Delivery Guide - Setting up bulk exports
- WSS Reference - WebSocket streaming documentation