Skip to Content

Multitenancy with SAP HANA Multitenant Database Containers (MDC)

Hi Experts,

I would like to develop a multitenant java app based on MDC.

Each tenant should get it's own TenantDB in MDC.

I have found some tutorials how the provide a schema-based solution (1 schema per tenant in one DB using Hibernate/JPA).
But how is it working with HANA TenantDB's?

Best regards
Oliver

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 26 at 04:36 PM

    Hi Oliver,

    Have you seen this blog already on multi tenancy development on SCP?

    Regards,
    Ivan

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Oliver,

      Sorry, but the information I've sent before is not really correct. The binding is done in the context of the provider account. So you need to treat the Hana Tenant ID when you obtain a connection to the database. You are able to retrieve the sub-account name (scp's tenant) and map to a database tenant.

      1) Use the account api to retrieve the subscriber ID:

      2) Use switch case statement to map account Id to db tenant Id and build the connection string to the default database. Here you specify the databaseName parameter to identify to which db tenant the connection should go thru.

      Regards,
      Ivan