How to start using Bytebase for team database cooperation
Published: 2022-04-27 06:26:53

Suppose you are a DBA / Database Administrator (or other roles related to database) and want to try [Bytebase](https://bytebase.com/)  with an existing project to **increase the efficiency of database team cooperation** and **decrease the possibility of a database outage**. After [installing it](https://www.bytebase.com/docs/install/install-with-docker), what should you do?

Short answer: Prepare a **project** for the team, and this article will give you the answer in detail. 


If you already have 1. an up-running Bytebase and 2. a working database, you can move forward.

If not, my previous articles might help you prepare: 
- [How to deploy Bytebase on Render](https://devrel.bytebase.com/how-to-deploy-bytebase-on-render)
- [Import sample database into AWS RDS MySQL using Shell & Workbench](https://devrel.bytebase.com/import-sample-database-into-aws-rds-mysql-using-shell-and-workbench)


## Environment

Real-life pipelines are usually more complex with more environments, e.g., test/stage/.../prod; here, we simplify them into Test and Prod.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650948172447/iZgsoPufS.png)


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650948181209/OD1iMQPWG.png)


The default setting is enough for me; you can make adjustments to fit your needs:
- No manual approvals are required on Test -  developers can run SQLs without DBAs' permission. DBAs only review queries if they're going to execute on Prod.
- Weekly backup on Prod.



## Instance 

**Database Instance** or simply **Instance** models after a single database instance are usually accessed via a host:port address. In our case, 2 AWS RDS MySQLs.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650949167336/hvTDNvhWk.png)

Back to Bytebase, we click Instances -> Add Instance.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028001414/nYtIwM9fw.png)
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650949222224/hvUSl8pFF.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650949233916/2WLCj2BXq.png)

After filling in the data, our first instance is ready.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650949241990/sHdkvLx_h.png)

Then we repeat the process. Instances for Test and Prod are ready.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650949249491/sdkZxfEZV.png)

If databases on AWS are updated, you can always sync them by clicking the button or waiting for the next round of auto checks.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1650949257368/1A5TCW4c2.png)

## Project

Project here is similar to the project concept in other dev tools such as **Jira, GitLab**. It's the **container** to group logically related Databases, Issues, and Users. 

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028454611/FVqxXRbyK.png)

Let's choose **Standard** this time.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028462021/GphLdz-wX.png)

There are shortcuts categorized by database/project on the left menu. You can also do bookmarks.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028471611/35NQqfMnn.png)

As the above screenshot suggests, let's click "Transfer in DB" to fill the empty project with some databases.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028480141/cz3xppn0y.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028524982/iaftuFDcz.png)


Finish, and you can view the databases and history.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028534352/vh1t3qFXs.png)


Last but not least, under settings within a specific project - in our case, Employee, you can now invite your project DBAs and developers from your team!

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028746906/qEKRriGGH.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651028852631/F7gn19eAS.png)

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1651047027147/jysB8ERty.png)



Hooray! It's all set now!