Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
JavaDevTeam
notes
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
notes
/
BS高并发架构.java
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
56 lines (44 loc) · 1.53 KB
master
Breadcrumbs
notes
/
BS高并发架构.java
Copy path
Top
File metadata and controls
Code
Blame
56 lines (44 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
BS架构
,
首先要考虑的三个问题
1
,
数据存储架构
2
,
开发架构
3
,.
负载均衡
1
,
数据存储架构
*
这东西一般是DBA需要掌握的东西
*
架构师进行部署
,
DBA完成细节
1
,
数据从集中走向分布
*
Oracle
,
一般并发在5K左右
.
它的性能应该算是最好的
.
A
,
数据复制的方式
*
每台数据库中的数据完全一样
问题
:
1
,
数据全量复制
2
,
增量同步
,
修改同步
*
大多数数据库服务器都有主备机制
,
也就是传说中的
Master
/
Slaver机制
,
并且能够自动的实现全量复制
,
增量同步
,
主备切换
*
Slaver可以是多台
,
任何一台宕掉都无所谓
.
可以切换主备
优点
:
1
,
某个服务器宕掉了
,
另一个服务器还可以使用
.
*
只能解决并发大的问题
,
如果是数据库中数据量大产生的性能瓶颈
,
就没辙了
B
,
分片的方式
(
垂直切分
)
*
这是目前互联网上数据分布式采用最多的方式
*
每台数据库中的数据不一样
*
分模块存放数据
(
商品
,
用户
,
订单
,
存放不同的服务器
)
*
按照功能模块划分数据
DBA的活儿
,
刚从集中到分布式
,
是要人工去完成的
问题
:
1
,
某个模块的数据源并发异常高
,
可能无法再细致的划分
解决方案
:
读写分离
,
异构数据源之间的读写分离
*
这种方式就涉及到了
'跨数据源查询'
,
俩数据源肯定是不能之间join
.
必须由一个数据源的结果
,
去另一个数据源查询
这比较影响性能
,
要注意SQL优化
2
,
事物的问题
*
多个模块的的数据是不同的
,
*
有分布式的事务解决方案
,
JTA
(
不提倡
,
性能差
)
*
不用分布式的事物
,
只解决单个数据源的小事务
,
通过程序来控制zhengti
这个对程序要求比较高
,
需要书写高质量的代码
b
,
水平切分
*
解决数据量大的问题
,
*
把一张表
,
变成多张表
*
分库分表存储
*
开始都是DBA人工操作
*
要注意的是拆分标准
*
根据规则来拆分表
(
例如
,
用户表
,
可以根据地区
,
姓名来进行拆分
),
很多公司都有这种算法
*
这东西其实是有很多难点
*
表拆分之后
,
与之相关联的表的一系列问题
You can’t perform that action at this time.