当前位置:网站首页>Mysql千万级别数据存储优化
Mysql千万级别数据存储优化
2022-07-19 05:02:00 【IT界刘德华】
因为公司是做短信业务的,随着数据量的增加每天新增数据将近200w+,数据全部存放至Mongodb中,总数据量将近3.2亿,业务查询相关出现缓慢,于是决定将一周以前的数据存储至Mysql中并对其进行优化处理。
公司内部方案
- 方案一:采用Tidb进行查询优化
优点:支持高并发、高可用支持无限水平扩展。
详细可见:(https://pingcap.com/docs-cn/dev/key-features/#%e6%b0%b4%e5%b9%b3%e6%89%a9%e5%b1%95)。
数据量少时没什么明显,千万级别出现明显优化查询但是大批量分页查询还是会比较迟钝的,如:分页查询仍然会比较慢,比如查询至9000页以上数据出现仍然很慢
缺点:维护成本高,服务器配置要求较高
2. 方案二:Oracle采用“物化视图”进行优化
详细见:https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_2001.htm
3. 方案二:Mysql采用水平分表、垂直分表优化(采取方案)
优点:维护成本低,门槛低人人可维护,如果后期需要转移则可直接将Mysql数据转移至Tidb中
业务:将Mongodb中一周以前的数据转移至Mysql,每天将近300w+数据量,双十一高峰时期一天1000W+数据量,转移至Mysql中。
MyISAM水平分表优化:https://blog.csdn.net/qq_31150503/article/details/105450236
分区优化:https://blog.csdn.net/qq_31150503/article/details/105451273
解决方案:
采用定时任务每天将Mongodb中的数据查询并迁移保存至Mysql中
实现方案:
https://blog.csdn.net/qq_31150503/article/details/105451876
存储方案:
https://blog.csdn.net/qq_31150503/article/details/105451273
边栏推荐
- 一篇文章让你彻底搞懂关于性能测试常见术语的定义
- C Foundation (I)
- 自定义redis工具jar包供其他项目模块直接引用
- C# 基础(三)
- Report on Market Research and investment prospects of China's yellow blood salt and potassium industry (2022 Edition)
- Where is Jay Chou's album "the greatest work"? Dangbei box enjoys chairman Zhou's latest MV
- C语言编程题:(C语言)分糖果 通俗易懂
- 无重叠区间[贪心练习]
- 10 ppt pages, understand SaaS customer life cycle
- CnosDB 涅槃重生:弃用Go, 全面拥抱Rust
猜你喜欢
随机推荐
Codeforces 429E 2-SAT
【MATLAB appdesigner】27_如何在appdesigner中调试,查看变量?(举例+技巧)
New concept three volume notes-01
C Foundation (I)
Flask framework - model relationships (many to many)
Summary of interview questions (4) TCP / IP four-layer model, three handshakes and four waves, one more and one less. No, the implementation principle of NiO
STM32 SCT memory control
TS之namespace與module
CountDownLatch
MySQL for enterprise development (I)
Tkinter module GUI Graphical programming practice (VIII) -- Chinese chess (including super detailed and complete source code, free download link of complete program)
下次面试官再问高并发系统设计,直接把这篇文章甩给他
Hc-sr04 ultrasonic module driven by 51 single chip microcomputer (LCD1602 display)
升级PHP8中踩到的坑
Compiler division optimization
TensorFlow 2 详解(tf生态系统、安装、内务管理、基本操作)
如何区分固态硬盘和机械硬盘
TCP与UDP的区别
新概念三册笔记-01
Where is Jay Chou's album "the greatest work"? Dangbei box enjoys chairman Zhou's latest MV