当前位置:网站首页>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.
边栏推荐
- 21天打卡挑战学习MySQL——《MySQL工具的使用》第一周 第二篇
- 2022-08-03 oracle执行慢SQL-Q17对比
- 函数,递归以及dom简单操作
- 113. 授人以渔 - 如何自行查询任意 SAP UI5 控件属性的文档和技术实现细节
- 中国企业构建边缘计算解决方案的最佳实践
- 【云原生实用技巧】使用 skopeo 批量同步 helm chart 依赖镜像
- 九种方式,教你读取 resources 目录下的文件路径
- Teach a Man How to Fish - How to Query the Properties of Any SAP UI5 Control by Yourself Documentation and Technical Implementation Details Demo
- 目标检测的国内外研究现状
- dataframe multi-level index replace index df.swaplevel(axis=1)
猜你喜欢
Causes of Mysql Disk Holes and Several Ways to Rebuild Tables

CAS:1260586-88-6_生物素-C5-叠氮_Biotin-C5-Azide

XSS testing

shell编程基础

21天打卡挑战学习MySQL——《MySQL工具的使用》第一周 第二篇

E-commerce data warehouse ODS layer-----log data loading

2022-08-03 oracle执行慢SQL-Q17对比

【Odoo】硬核组件开发,全文没一句废话~

YOLO之父宣布退出CV界,坦言无法忽视自己工作带来的负面影响

测试2年6.5K,每天“911”,我的心酸经历只有我自己知道···
随机推荐
pikachu Over permission 越权
封装、包、访问权限修饰符、static变量
CAS:1260586-88-6_Biotin-C5-Azide_Biotin-C5-Azide
Codeup刷题笔记-简单模拟
STP生成树
CAS:1797415-74-7_TAMRA-Azide-PEG-Biotin
LabVIEW代码生成错误 61056
【bug】汇总Elipse项目中代码中文乱码解决方法!
从0到1看支付
483. Smallest Good Base
L2-029 特立独行的幸福
CAS:122567-66-2_DSPE-Biotin_DSPE-Biotin
VIM操作
中国企业构建边缘计算解决方案的最佳实践
4. Modular programming
Data_web(九)mongodb增量同步到mongodb
XSS online shooting range---prompt
Flink--Join以及Flink函数
nxp官方uboot移植到野火开发板PRO(无任何代码逻辑的修改)
382. Linked List Random Node