当前位置:网站首页>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.
边栏推荐
猜你喜欢
斩获双奖|易知微荣获“2021中国数字孪生解决方案优秀供应商”“中国智能制造优秀推荐产品”双奖项!
[kali-vulnerability scanning] (2.1) Nessus lifts IP restrictions, scans quickly without results, and plugins are deleted (middle)
老板:公司系统太多,能不能实现账号互通?
pikachu Over permission 越权
电商数仓ODS层-----日志数据装载
CAS:1797415-74-7_TAMRA-Azide-PEG-Biotin
October 2019 Twice SQL Injection
一文带你了解软件测试是干什么的?薪资高不高?0基础怎么学?
如何设计 DAO 的 PoW 评判标准 并平衡不可能三角
编译器工程师眼中的好代码(1):Loop Interchange
随机推荐
[b01lers2020]Life on Mars
JPA Native Query(本地查询)及查询结果转换
CAS:1620523-64-9_Azide-SS-biotin_biotin-disulfide-azide
for循环练习题
[kali-vulnerability exploitation] (3.2) Metasploit basics (on): basic knowledge
STP生成树
Codeup刷题笔记-简单模拟
ValidationError: Progress Plugin Invalid Options
距LiveVideoStackCon 2022 上海站开幕还有3天!
Causes of Mysql Disk Holes and Several Ways to Rebuild Tables
关于Yii2批量更新的操作
noip初赛
【历史上的今天】8 月 3 日:微软研究院的创始人诞生;陌陌正式上线;苹果发布 Newton OS
Data_web(九)mongodb增量同步到mongodb
IO thread process -> thread synchronization mutual exclusion mechanism -> day6
【刷题篇】二叉树的右视图
CAS: 1192802-98-4 _uv cracking of biotin - PEG2 - azide
HCIP第十四天
FVCOM 3D Numerical Simulation of Hydrodynamics, Water Exchange, Dispersion and Transport of Oil Spills丨FVCOM Model Watershed, Numerical Simulation Method of Marine Water Environment
码率vs.分辨率,哪一个更重要?