If I have two devs working on an application and I want to make sure they cannot see each others work. Can I set up two different schemas?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Yes, you can set up two different schemas to ensure that two developers working on an application do not see each other’s work.
Create Separate Schemas: In your database, create two separate schemas, one for each developer: CREATE SCHEMA schema_name;.
Assign Permissions: After creating the schemas, you need to set up permissions to ensure that each developer has access only to their respective schema. For example, you can use GRANT ALL PRIVILEGES ON SCHEMA schema_name TO user_name; to give a developer full access to their schema while restricting access to the other developer’s schema.
For more information on how to manage users and their permissions, I could suggest this documentaiton here:
https://docs.digitalocean.com/products/databases/postgresql/how-to/modify-user-privileges/
An alternative approach is to have separate databases on a single database cluster as well.
Hope that this helps!
Best,
Bobby
Heya @bigdarkbluecrab,
Yes, you can set up two different schemas in a database to segregate the work of two developers. This approach allows each developer to have a separate namespace where they can create, modify, and manage database objects (like tables, views, stored procedures, etc.) without interfering with each other’s work. Here’s how this can be done and some considerations to keep in mind:
Create Schemas: First, create two separate schemas in your database, one for each developer. The process of creating a schema varies depending on the database management system (DBMS) you’re using. For example, in SQL Server or PostgreSQL, you would use the CREATE SCHEMA statement.
Assign Permissions: Assign appropriate permissions to each developer for their respective schema. Ensure that each developer has full control over their schema but no or limited access to the other’s schema.
Schema Usage: Instruct each developer to create and work with database objects within their own schema. This ensures that their activities are isolated from each other.
Additionally, every managed database instance has a how-to/modify-user-privileges article which you can go over as soon as you decide on a DB you want to use,
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.