当前位置:网站首页>Bytebase database schema change management tool
Bytebase database schema change management tool
2022-08-03 22:09:00 【Starlight falls into my brother's eyes】
Bytebase 是一个开源数据库 DevOps 工具,It is equivalent to managing the database throughout the application development life cycle GitLab,它为 DBA and the developer provides a base Web 的工作空间,Collaborate and manage database changes securely and efficiently.
官网地址
随着 DevOps 进入主流,Most teams use it GitLab/GitHub and other tools to manage code,and start adopting Terraform 来管理基础设施,同样的 Bytebase One such tool is to manage databases during application development.Bytebase It is a supplement to the database platform of the existing cloud provider or the company's in-house database operation and maintenance platform,While these platforms are responsible for database instance level operations(For example configuring a database instance),但 Bytebase Will help teams build their applications using the configured database.
主要特征
Bytebase 是一款聚焦在 Database schema change and version control
的工具.它主打的是在应用研发过程中变更数据库数据结构 (schema) 的这个场景,主要面向的人群是研发工程师和 DBA.
架构(DDL)和数据(DML)Change review workflow:与代码审查一样,Bytebase Simplifies the database change process,in a single workflow,Database changes can be reviewed and deployed from the development environment all the way to the production environment.
SQL质量检查:Bytebase 分析 SQL Changes to enforce rules that align with your organization's policies.Enforcement includes naming conventions、反 SQL pattern detection, etc.Production and non-production environments can also enforce different rules separately.
SQL编辑器: 基于 Web for querying and exporting data SQL 编辑器,When developers need access to data,DBA It is no longer necessary to provide sensitive database credentials.
与VCSIntegrated version control:Bytebasecan be left intactSchemaChange history,它还与VCS系统(例如 GitLab)集成.团队可以在VCS中管理 SQL 迁移脚本,and fires when the code is submitted Schema 部署.
备份还原: Bytebase Manual and periodic backups at the database level are supported.
多租户支持:A multi-tenant service can create separate databases for each of its tenants,Bytebase Specific database change deployments can be managed for all tenants in a single workflow.
用例
▷ Multiple database management
Organizations often have multiple database systems to manageOLTP和OLAP工作负载.BytebaseSupports popular database systems,包括MySQL、PostgreSQL、ClickHouse、TiDB和Snowflake.
▷ Database change automation
与GitLab/GitHubHow to simplify code delivery is similar,BytebaseSimplifies the deployment of database changes from non-production to production environments.Bytebase还与VCS集成,支持GitOps工作流.您可以在VCSManage database change scripts in ,Just observe the new change script,BytebaseA new deployment process will start.
您还可以将Bytebase的CLI bbIntegrate into your existingCI/CD工作流中.
▷ Database developer portal
As the engineering team evolves,A platform team or dedicated will be formedDBAteam to manage the database infrastructure,And enable developers to interact with their application database.Bytebase为开发人员/数据库管理员/Platform Engineer provides a centralized portal,Used to collaborate on database-related tasks,Such as checking for database changes、查询数据、Backup and restore databases, etc.
▷ Multi-tenant service
SaaSA service can have a separate database for each of its tenants.Ensuring that database changes are consistently applied to each tenant's database is a pain and error-prone.BytebaseA tenant schema is provided to group these databases,And can manage the life cycle of these databases as a unit.
▷ Pattern implementation and engineering excellence
Data quality and system robustness depend heavily on the database schema.Being able to implement standards consistently is key to a high-quality model.BytebasePattern rules can be enforced,Include naming conventions、反SQLpattern detection, etc.You can also configure each individual rule separately for production and non-production environments.
部署
Docker
Bytebase Various deployment methods are provided,最简单就是使用 Docker One key start.
docker run --init -d \
--name bytebase \
--restart always \
--add-host host.docker.internal:host-gateway \
--publish 8080:8080 \
--volume ~/.bytebase/data:/var/opt/bytebase \
bytebase/bytebase:1.2.2 \
--data /var/opt/bytebase \
--host http://192.168.235.15 \
--port 8080
您可以将8080更改为5678或其他端口,But make sure the three ports are the same:
--publish { {hostport}} :{ {containerport}} --port { {port}}}
BytebaseIts data will be stored in ~/.bytebase/data,You can reset all data by running the command:
rm -rf ~/.bytebase/data
浏览器访问 http://192.168.235.15:8080/
Sign up for an administrator account The first registered account after deployment will be granted to the workspace owner(Workspace Owner)角色.
在Bytebase中,Workspace owner doneVCS配置.
Sign up for a recurring account After creating an administrator account,You can sign up for a regular account,并被授予Workspace Developer角色.
生产设置
确保 --host,--port
and the byte library should be accessiblehost:port地址完全匹配.
Bytebase使用 --host, --port to configure the project version control workflow to useVCS webhook回调.如果主机:Port does not match,then the submitted migration script will not trigger the issue creation in the byte library.如果Bytebase由Docker运行,请确保 --publish hostport:containerport和 --port 标志相同.
如下例所示,所有3All ports are5678: --publish 5678:5678 --port 5678
docker run --init --name bytebase --restart always --publish 5678:5678 --volume ~/.bytebase/data:/var/opt/bytebase bytebase/bytebase:<<version>> --data /var/opt/bytebase --host http://localhost --port 5678
无法用Docker启动Bytebase
docker logs bytebase
Due to the vm mechanism of colima, try to use the --mount option when starting colima as shown below:
mkdir ~/volumes
colima start --mount ~/volumes:w
docker run --init --name bytebase --restart always --add-host host.docker.internal:host-gateway --publish 8080:8080 --volume ~/.bytebase/data:/var/opt/bytebase bytebase/bytebase:1.1.0 --data /var/opt/bytebase --host http://localhost --port 8080
部署到Kubernetes
We can deploy using the most basic list of resources below Bytebase,最好使用一个 Volume 来持久化数据,这里我们定义的是一个 LoadBalancer 类型的 Service,Of course we can also create one Ingress object to expose,Which method to use depends on you Kubernetes cluster to decide,Modifications can be made based on the resource list below.
apiVersion: apps/v1
kind: Deployment
metadata:
name: bytebase
namespace: default
spec:
selector:
matchLabels:
app: bytebase
template:
metadata:
labels:
app: bytebase
spec:
containers:
- name: bytebase
image: bytebase/bytebase:1.2.2
args: ["--data", "/var/opt/bytebase", "--host", "http://localhost", "--port", "8080"]
ports:
- containerPort: 8080
volumeMounts:
- name: data
mountPath: /var/opt/bytebase
volumes:
- name: data
emptyDir: {
}
---
apiVersion: v1
kind: Service
metadata:
name: bytebase-entrypoint
namespace: default
spec:
type: LoadBalancer
selector:
app: bytebase
ports:
- protocol: TCP
port: 8080
targetPort: 8080
直接在 Kubernetes The above objects can be deployed in the cluster.
脚本
此外我们还可以使用 Bytebase Officially provided installation script to install,The installation script is stored in https://github.com/bytebase/install
Install the latest released version using the install script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bytebase/install/master/install.sh)"
如果没有出现错误,You should see something like the following in the console
OS: Darwin
ARCH: arm64
Password:
Get bytebase latest version: x.y.z
Downloading tarball into /var/folders/j4/9x356cb9263f2jryv0xs9pnr0000gn/T/tmp.g1C2PJ8U
Start downloading https://github.com/bytebase/bytebase/releases/download/x.y.z/bytebase_x.y.z_Darwin_arm64.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
100 81.3M 100 81.3M 0 0 3972k 0 0:00:20 0:00:20 --:--:-- 5430k
Completed downloading https://github.com/bytebase/bytebase/releases/download/x.y.z/bytebase_x.y.z_Darwin_arm64.tar.gz
Start extracting tarball into /opt/bytebase...
Start installing bytebase and bb x.y.z
Installed bytebase x.y.z to /usr/local/bin
Installed bb x.y.z to /usr/local/bin
Check the usage with
bytebase --help
bb --help
安装完成后,运行:
bytebase --host http://localhost --port 8080
You should see something like this in the console:
Version x.y.z has started at http://localhost:8080
卸载 Bytebase
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bytebase/install/master/uninstall.sh)"
' If you want to run it non-interactively bytebase 卸载程序,你可以使用:
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bytebase/install/master/uninstall.sh)"
I will always love the life I never deviated from.
边栏推荐
- 2022的七夕,奉上7个精美的表白代码,同时教大家快速改源码自用
- IO thread process -> thread synchronization mutual exclusion mechanism -> day6
- 三年黑盒测试工程师对嵌入式软件测试的理解
- 4. Modular programming
- 测试2年6.5K,每天“911”,我的心酸经历只有我自己知道···
- L2-029 特立独行的幸福
- 如何设计 DAO 的 PoW 评判标准 并平衡不可能三角
- CAS:1797415-74-7_TAMRA-Azide-PEG-Biotin
- 【Unity3D】Tank对战
- 480. Sliding Window Median
猜你喜欢
CAS:122567-66-2_DSPE-生物素_DSPE-Biotin
Bytebase数据库 Schema 变更管理工具
授人以渔 - 如何自行查询任意 SAP UI5 控件属性的文档和技术实现细节试读版
21天打卡挑战学习MySQL——《MySQL工具的使用》第一周 第二篇
距LiveVideoStackCon 2022 上海站开幕还有2天!
嵌入式系统:概述
21天打卡挑战学习MySQL——《Window下安装MySql》第一周 第三篇
LyScript 实现应用层钩子扫描器
今晚直播 | 8.2-8.4 与你聊聊开源与就业那些事!
nxp官方uboot移植到野火开发板PRO(修改LCD部分和网络部分)
随机推荐
for循环练习题
472. Concatenated Words
dataframe multi-level index replace index df.swaplevel(axis=1)
如何设计 DAO 的 PoW 评判标准 并平衡不可能三角
[N1CTF 2018]eating_cms
关于Yii2批量更新的操作
Pay from 0 to 1
如何基于WPF写一款数据库文档管理工具(二)
数据一致性:双删为什么要延时?
480. Sliding Window Median
CAS:122567-66-2_DSPE-Biotin_DSPE-Biotin
聚焦开源与联合共创|麒麟软件出席开源峰会欧拉分论坛
上课笔记(6)(1)——#629. 表达式括号匹配(stack)
gtk实现图片旋转
CAS: 1192802-98-4 _uv cracking of biotin - PEG2 - azide
HCIP第十六天
Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo
JPA Native Query(本地查询)及查询结果转换
Android build error: Plugin with id 'kotlin-android' not found.
What is the role and difference between buildscript and allprojects?