惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
V
Vulnerabilities – Threatpost
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
C
Comments on: Blog
P
Privacy International News Feed
Attack and Defense Labs
Attack and Defense Labs
The Hacker News
The Hacker News
M
Microsoft Research Blog - Microsoft Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
G
Google Developers Blog
D
Docker
博客园 - Franky
T
Tor Project blog
Vercel News
Vercel News
小众软件
小众软件
J
Java Code Geeks
B
Blog RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
S
SegmentFault 最新的问题
F
Fox-IT International blog
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
L
Lohrmann on Cybersecurity
E
Exploit-DB.com RSS Feed
Spread Privacy
Spread Privacy
腾讯CDC
S
Securelist
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
Scott Helme
Scott Helme
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
IT之家
IT之家
F
Full Disclosure
GbyAI
GbyAI
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
V
Visual Studio Blog
T
ThreatConnect
Y
Y Combinator Blog
A
About on SuperTechFans
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

V2EX

暂无文章

求助:如何高效存储和查询大规模加密货币 K 线数据?
Noah1984 · 2025-03-07 · via V2EX

最近折腾了一个小项目 https://cryptopricedata.com/ ,主要是提供加密货币的历史 K 线数据( OHLCV ),供做交易策略、回测或者研究用。目前数据量已经有点上来了,遇到了一些存储和查询性能的问题,想请教下大家的经验。

目前的技术方案: 数据源:从多个交易所拉取 K 线数据,按交易对、时间粒度存储 存储:最开始是用 MySQL ,后来数据量上来后改成了 PostgreSQL + TimescaleDB API 提供:FastAPI + Redis 缓存 目前遇到的问题: 查询性能:对于大量历史数据(比如拉取某个币对过去几年的分钟级 K 线),查询速度不够理想,即使加了索引和分区,某些查询还是会比较慢。 数据更新:K 线数据是不断增量更新的,插入新数据的效率也是个问题。特别是有些交易所有时会补充历史数据,导致需要做去重和合并处理。 存储优化:TimescaleDB 的压缩功能用过,但效果一般。想知道有没有更好的存储结构或者方案? V 站里做量化或者大规模时序数据存储的朋友,有没有类似的经验?有没有推荐的架构或者数据库方案?欢迎讨论,也欢迎拍砖! 😃