Multiple microservices connecting to single Oracle server

Viewed 218

I'm more used to a PostgreSQL world and am now struggling with Oracle.

I have multiple microservices with Spring Boot which use Flyway for database migration. With PostgreSQL, I would create a "database" for each microservice (e.g. createdb -O microservice1_user microservice1 and createdb -O microservice2_user microservice2) so that the tables don't clash and each microservice has its own flyway_schema_migration` table.

I have now access to one Oracle server. I have administrator access (if I'm not mistaken - I have an owner and a support user account). What would be the best practice here? Can I create the equivalent of a "databases" (I think they are "schemas" in Oracle? And each schema is also a user?) for each microservice? Do I need to prefix the tables (I really would like to avoid that)?

Thanks!

1 Answers

SCHEMA and USER are practically synonymous in Oracle - so yes, each of your databases could be represented as a SCHEMA in Oracle.

However, if a user is granted privs, it would allow them to see data in another schema.

If you need a harder 'partition' then you could use the multitenant feature in Oracle.

You would then have a separate pluggable database for each microservice. Each could have one or more schemas, but they wouldn't be able to accidentally or otherwise access the data from another pluggable database.

We have customers who have implemented both architectural styles, so there's not necessarily a right or wrong way.

Going with multiple schemas in a single database is obviously the simpler way to go.

Related