id: 21cd09088c1747bf98b5c06a8f371166
parent_id: 
item_type: 1
item_id: 17b69a8232da4167977f676d17db3119
item_updated_time: 1764365025041
title_diff: "[{\"diffs\":[[1,\"普通人做量化，数据库该怎么选？\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":15}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>普通人做量化，数据库该怎么选？</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"47183\\\"></a>\\\r\\\n<h1>普通人做量化，数据库该怎么选？</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"\\\"><div style=\\\"max-width: 700px;\\\"><p></p><div style=\\\"--en-blockquote: true; box-sizing: border-box; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial;\\\"><div>原文链接: <a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180405&amp;idx=1&amp;sn=06017fc819ca9e24b300f35fba616d0a&amp;chksm=86bbc52af50e08d9f6fb56f0dd16206c82ef4a5f8589c8fb4d7eb54d6d99e6c06cd572bce121&amp;mpshare=1&amp;scene=1&amp;srcid=0821U6Gfudp7RFO9XGrm6PaD&amp;sharer_shareinfo=e3f3d08c7206b8450d965fbcaff48fc8&amp;sharer_shareinfo_first=e3f3d08c7206b8450d965fbcaff48fc8#rd\\\"><span>https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=264818...</span></a></div></div><p></p><div style=\\\"\\\"><div><div><div><span style=\\\"\\\">原创</span><span><span style=\\\"\\\">花小姐的春天</span></span><span><a style=\\\"\\\"> 花小姐的春天 </a></span><span><em></em></span></div><div style=\\\"\\\"><div style=\\\"color: black; word-spacing: 0px; letter-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: justify;\\\"><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>做量化，绕不开数据库。很多刚入门的朋友一上来就问我：花姐，数据库这么多，到底用哪个？要不要一上来就整一套像大机构那样的分布式数据库？</span></p><div style=\\\"text-align: center;\\\"><img src=\\\"普通人做量化，数据库该怎么选？_files/640.png\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>我先说结论：</span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>普通人做量化，数据库别贪大求全，先够用，后扩展。</span></strong></p><h2 style=\\\"font-weight: bold; color: black; font-size: 22px; text-align: left;\\\"><span style=\\\"font-size: 22px; color: #0e88eb; font-weight: bolder; border-left: 5px solid #0e88eb;\\\"><span>一、你先想清楚，你的量化规模多大？</span></span></h2><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>数据库不是摆设，它解决的核心问题就两个：</span></p><ol style=\\\"color: black; list-style-type: decimal;\\\"><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>存得下</span></strong></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>取得快</span></strong></div></li></ol><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>普通人量化，早期数据量很有限——A股全市场日线数据加上财报、公告，压缩后几十个G就够了。即便加上分钟级数据，硬盘也能装得下。所以不用一上来就考虑分布式，先用好本地或轻量级的方案。</span></p><h2 style=\\\"font-weight: bold; color: black; font-size: 22px; text-align: left;\\\"><span style=\\\"font-size: 22px; color: #0e88eb; font-weight: bolder; border-left: 5px solid #0e88eb;\\\"><span>二、三种主流选择</span></span></h2></div><div style=\\\"text-align: center;\\\"><img src=\\\"普通人做量化，数据库该怎么选？_files/640 [1].png\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><div style=\\\"color: black; word-spacing: 0px; letter-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: justify;\\\"><h3 style=\\\"font-weight: bold; color: #0e88eb;\\\"><span style=\\\"color: #0e88eb;\\\"><span>1. </span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>CSV/Parquet 文件 + Pandas</span></strong></span></h3><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>最简单粗暴，直接用文件存，Python随时读。</span></p><ul style=\\\"color: black; list-style-type: disc;\\\"><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>优点</span></strong><span>：零门槛，适合探索阶段，复制粘贴就能用</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>缺点</span></strong><span>：数据一多（比如上G），IO效率就会拖垮回测速度</span></div></li></ul><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>如果你还在练手阶段，这种方案完全没问题，别嫌土。</span></p><h3 style=\\\"font-weight: bold; color: #0e88eb;\\\"><span style=\\\"color: #0e88eb;\\\"><span>2. </span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>SQLite / DuckDB</span></strong></span></h3><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>本地单文件数据库，轻量级神器。</span></p><ul style=\\\"color: black; list-style-type: disc;\\\"><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>SQLite</span></strong><span>：稳定、简单，很多小型量化项目够用</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>DuckDB</span></strong><span>：近两年特别火，特别擅长分析型查询（批量聚合、回测）</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>适用场景</span></strong><span>：单机、数据量在几十G以内，想要 SQL 查询的便利性</span></div></li></ul><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>我个人非常推荐 </span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>DuckDB</span></strong><span>，速度和易用性都比 SQLite 爽。</span></p><h3 style=\\\"font-weight: bold; color: #0e88eb;\\\"><span style=\\\"color: #0e88eb;\\\"><span>3. </span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>PostgreSQL / MySQL</span></strong></span></h3><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>如果你数据逐渐多起来，或者想和 Web 服务对接，这两位才是大杀器。</span></p><ul style=\\\"color: black; list-style-type: disc;\\\"><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>PostgreSQL</span></strong><span>：功能强大，适合结构化和半结构化数据</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>MySQL</span></strong><span>：社区成熟，资料多</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>适用场景</span></strong><span>：多人协作、数据多源整合、要做策略在线部署</span></div></li></ul><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>但注意，自己搭这些数据库，</span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>有学习成本</span></strong><span>，别因为折腾环境耽误了研究策略。</span></p><div style=\\\"text-align: center;\\\"><img src=\\\"普通人做量化，数据库该怎么选？_files/640 [2].png\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><h2 style=\\\"font-weight: bold; color: black; font-size: 22px; text-align: left;\\\"><span style=\\\"font-size: 22px; color: #0e88eb; font-weight: bolder; border-left: 5px solid #0e88eb;\\\"><span>三、别急着上云或分布式</span></span></h2><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>很多朋友一开始就盯着云数据库、大数据方案（像 ClickHouse、Spark 之类的），这些</span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>确实牛，但没必要早期就搞</span></strong><span>。 你个人电脑都没跑满，何必折腾上云，花钱还麻烦？等你做到资金量大、策略复杂，瓶颈真来了，再考虑升级。</span></p><h2 style=\\\"font-weight: bold; color: black; font-size: 22px; text-align: left;\\\"><span style=\\\"font-size: 22px; color: #0e88eb; font-weight: bolder; border-left: 5px solid #0e88eb;\\\"><span>四、实用建议</span></span></h2><ul style=\\\"color: black; list-style-type: disc;\\\"><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><span>量化新手：</span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>DuckDB + 本地文件</span></strong><span>，性价比最高</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><span>数据量上百 G，再升级 PostgreSQL 或 ClickHouse</span></div></li><li><div style=\\\"text-align: left; color: rgb(1,1,1); font-weight: 500;\\\"><span>文件结构要规划好，别乱堆，后期查找很痛苦</span></div></li></ul><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>记住，数据库只是工具，</span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>策略才是核心</span></strong><span>。别本末倒置。</span></p><div style=\\\"color: black; letter-spacing: 0px; word-break: break-word;\\\"><hr style=\\\"height: 1px; border-width: initial; border-style: none; border-color: initial; text-align: center; background-image: linear-gradient(to right, rgba(248, 57, 41, 0), rgb(14, 136, 235), rgba(248, 57, 41, 0));\\\"/><h3 style=\\\"font-weight: bold; color: rgb(14,136,235); text-align: center;\\\"><span>往期文章精选</span></h3><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180192&amp;idx=1&amp;sn=652964c5ca54c6f260ee99495b1325f0&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">分享一个年化96%的小市值策略</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180136&amp;idx=1&amp;sn=6417f7d46b61a6ae2980cef2b99a79b5&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">给你的DeepSeek装上实时行情，让他帮你炒股</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180211&amp;idx=1&amp;sn=40277deb2298787fa10bae659ffe11c1&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">一篇文章让你彻底搞懂量化中RSI指标，附实战策略+附源码，建议收藏</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180170&amp;idx=1&amp;sn=55c81969818cfda18f9a9ff6911fb649&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">一招横盘突破选股法，赚钱不靠运气靠图形，靠概率！</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180029&amp;idx=1&amp;sn=3d23246dcd0ba344a6cf2e062ada681d&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">MiniQMT+Backtrader：平民股票量化界的“黄金搭档”，永远的神！</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180017&amp;idx=1&amp;sn=fd32530368959e3e38694938df217978&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">万字干货：用神经网络预测股市，这次真的讲透了，Python+神经网络实战全流程（附源码）</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648179985&amp;idx=1&amp;sn=e72d6338a742e8bf093ee8e014ae7d23&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">在A股开超市到底靠谱不靠谱（附源码）</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648179944&amp;idx=1&amp;sn=35c04078d04cab0f291de825daf4c002&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">1年10倍，全网都在说的尾盘选股法我用Python帮你们实现了</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648179891&amp;idx=1&amp;sn=b2604c30c923afbaa7cbd19f789abb63&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">一文读懂量化交易中最常用的5种均线，附源码，建议收藏</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648179731&amp;idx=1&amp;sn=0eadf8c919f84ba816ad055378f2e69a&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">下跌行情你不妨试试这种技术形态，胜率90%，我用Python实测了【附量化源码】</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180292&amp;idx=1&amp;sn=2bb4ec93da670a9070fbaf99a1dc308e&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">炒股我只会这一招，一年翻倍，成功打败了90%的韭菜</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180372&amp;idx=1&amp;sn=0a7b7a4c50e6a54b41c8095065ee4311&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">年化96%的小市值策略的选股逻辑源码来了</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180366&amp;idx=1&amp;sn=9862c71ad40ffbbf75e282eb53974603&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">牛市不是等出来的，是提前感知出来的：花姐教你打造自己的A股情绪指标</a></span><span><br/></span></p><p style=\\\"\\\"><span><a href=\\\"https://mp.weixin.qq.com/s?__biz=MzA4NjY2Nzg0NA==&amp;mid=2648180352&amp;idx=1&amp;sn=505c29aa9e4637ed6bf94e261dd14e8c&amp;scene=21#wechat_redirect\\\" style=\\\"\\\" target=\\\"_blank\\\">从0到1打造一套小白也能跑得起来的量化框架[图文教程]</a></span><span><br/></span></p><div style=\\\"color: black; letter-spacing: 0px; word-break: break-word;\\\"><hr style=\\\"height: 1px; border-width: initial; border-style: none; border-color: initial; text-align: center; background-image: linear-gradient(to right, rgba(248, 57, 41, 0), rgb(14, 136, 235), rgba(248, 57, 41, 0));\\\"/><h3 style=\\\"font-weight: bold; color: rgb(14,136,235); text-align: center;\\\"><span><span>关于花姐</span></span></h3><p style=\\\"letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span>花姐，专注于Python量化与股票策略研究，兼顾Python基础知识分享，内容实用接地气，擅长用代码解读市场，用策略提升认知，干货满满，务实至上。</span></p><p style=\\\"letter-spacing: 0.2em; word-spacing: 0.1em; text-align: center;\\\"><span>👇</span><span style=\\\"color: rgb(255, 76, 0);\\\"><span>关注</span></span><span>+</span><span style=\\\"color: rgb(255, 76, 0);\\\"><span>星标</span></span><span>花姐公众号 第一时间看到推文👇</span></p><p style=\\\"letter-spacing: 0.2em; word-spacing: 0.1em; text-align: center;\\\"><span>如果文章对你有帮助，还请点「</span><span style=\\\"color: rgb(255, 76, 0);\\\"><span>推荐</span></span><span>」支持一下花姐</span></p><p style=\\\"letter-spacing: 0.2em; word-spacing: 0.1em; text-align: center;\\\"><span>---    </span><strong style=\\\"font-weight: border; color: #0e88eb;\\\"><span>End</span></strong><span>     ---</span></p></div><p style=\\\"\\\"><span><a style=\\\"color: #576B95;\\\">#量化</a><a style=\\\"color: #576B95;\\\">#股票量化</a><a style=\\\"color: #576B95;\\\">#数据库</a><a style=\\\"color: #576B95;\\\">#Python量化</a></span></p></div><p style=\\\"\\\"><span><br/></span></p><p style=\\\"color: black; letter-spacing: 0.2em; word-spacing: 0.1em;\\\"><span><br/></span></p></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":14077}]"
metadata_diff: {"new":{"id":"17b69a8232da4167977f676d17db3119","parent_id":"f67288c3a0be4374b5d532b5dcc3aabc","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764348863406,"user_updated_time":1764345641996,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":1764365025041},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T21:24:54.319Z
created_time: 2025-11-28T21:24:54.319Z
type_: 13