简体   繁体   English

在一个 AWS Redshift 实例下创建(实际上)多个数据库

[英]Create (virtually) multiple databases under one AWS Redshift instance

We are using AWS RDS Postgres at the moment and are thinking of shifting to AWS Redshift.我们目前正在使用 AWS RDS Postgres,并考虑转向 AWS Redshift。

Problem问题

We want to create two databases (1 for STAGING, 1 for PRODUCTION) under it but we came to know that we can only create ONE database under an instance.我们想在它下面创建两个数据库(1 个用于 STAGING,1 个用于 PRODUCTION)但我们知道我们只能在一个实例下创建一个数据库。

Research研究

I found this answer which said that I can create multiple schemas and then simply set the default schema for roles that way I can virtually achieve different databases for PROD and QA and I will not have to change any of my queries.我发现这个答案说我可以创建多个模式,然后简单地为角色设置默认模式,这样我就可以虚拟地为 PROD 和 QA 实现不同的数据库,而且我不必更改任何查询。 But while reading the developer guide , at page 382 I read that DATABASE ROLES is listed under Unsupported PostgreSQL Features .但是在阅读开发人员 指南时,在第 382 页我读到DATABASE ROLES列在Unsupported PostgreSQL Features

Question

How can I achieve this functionality given my use case in AWS Redshift?鉴于我在 AWS Redshift 中的使用案例,我该如何实现此功能?

With Redshift you can create multiple databases within one cluster.使用 Redshift,您可以在一个集群中创建多个数据库。 (max of around 60) (最多约 60 个)

the command命令

create database newdbname;

will do this.会这样做。

Any one query can ONLY access one database at a time so correct permissions can be set up per database.任何一个查询一次只能访问一个数据库,因此可以为每个数据库设置正确的权限。

So, I think you have everything you need.所以,我认为你拥有你需要的一切。

ref:参考:

https://docs.aws.amazon.com/redshift/latest/dg/r_Privileges.html https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_DATABASE.html https://docs.aws.amazon.com/redshift/latest/dg/r_Privileges.html https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_DATABASE.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM