DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Enterprise AI Trend Report: Gain insights on ethical AI, MLOps, generative AI, large language models, and much more.

2024 Cloud survey: Share your insights on microservices, containers, K8s, CI/CD, and DevOps (+ enter a $750 raffle!) for our Trend Reports.

PostgreSQL: Learn about the open-source RDBMS' advanced capabilities, core components, common commands and functions, and general DBA tasks.

AI Automation Essentials. Check out the latest Refcard on all things AI automation, including model training, data security, and more.

Related

  • Data Encryption Is the First Line of Defense Against Identity Theft and Cybercrime
  • The Impact of Biometric Authentication on User Privacy and the Role of Blockchain in Preserving Secure Data
  • A Guide to Vector Embeddings for Product and Software Engineers
  • The Role of Zero-Knowledge Proofs in LLM Chains for Data Privacy

Trending

  • DZone's Article Types
  • Harnessing the Power of Observability in Kubernetes With OpenTelemetry
  • Top Secrets Management Tools for 2024
  • The Power of Generative AI: How It Is Revolutionizing Business Process Automation
  1. DZone
  2. Data Engineering
  3. Data
  4. Separation of Tenants in Software Design

Separation of Tenants in Software Design

This article presents the author's point of view on how to separate data, configuration, and other relevant aspects by showing different approaches and discussing them.

By 
Fabian Lemke user avatar
Fabian Lemke
·
Mar. 26, 24 · Opinion
Like (1)
Save
Tweet
Share
729 Views

Join the DZone community and get the full member experience.

Join For Free

In the deployment of software, multi-tenant systems make sense for separating teams or different customers with different use cases. Ideally, a tenant is separated as if it is running on its own system and has all configuration options and network security options individually configured. 

On the other hand, complexity should still be manageable, to make sure errors can be analyzed quickly and new personnel is onboarded quickly. 

In this post, I want to explore some concepts and ideas, as well as best practices. First, let us look at common concepts and ideas. 

Generally, default patterns are useful for onboarding new features. Of course, each goal/software solution is unique and needs to be planned individually.

I am thankful for any comment or discussion. This is my current point of view, which might change in the future.

Databases

Most environments have a persistence in some sort of database. These could be a document, graph, relational, or other concept. 

Following separations are possible:

  • All data in one scheme: tenant connection determined via references to the tenant. Cross-connection is easy.
  • Own scheme for each tenant: every tenant access needs separate authentication. 

Additionally, there can be a management scheme, containing general information and references to the tenants, this can be a general database scheme or can be defined in the configuration.

Although the complexity is higher I would mostly choose the multi-scheme approach. The higher complexity of reaching other tenants' data from within the context is much harder. In this approach persisted data can even be physically separated.

Authentication

Authorization is one of the core security gateways. Generally, standardized and tested approaches should be used. The current state of the art would be OAuth2/OIDC, which is an open standard, integrated with a lot of frameworks, and security and best practices are available broadly.

Here are two concepts:

  • One identity provider
  • Separate identity providers

Identity Provider (IDP) could also be a REALM or App, depending on the wording.

Technology-wise it is easiest to have one provider. within the source code, only one IAM needs to be checked, and changes within the token information/structure need to be done for all Identity Providers. In the case of one identity provider, the tenant needs to be in the Token, to verify resource access. 

On the other hand, it is much harder to get a valid access token with escalated privileges from another identity provider. In this case for example, when logging in the login page forwards to the correct IDP, or the reference to the correct IDP is in the URL/FQDN.

Services

Looking at resource costs, the goal is to allocate as few resources as possible. So, most of the time it makes sense to share the service instances and check the tenant within.

For safer environments, it can make sense to deploy a separate service, which only gets access to the data of the connected tenant. In this case, only the services dealing with sensitive data should be scaled like this. Data then can be forwarded to the right service by the gateway. It makes sense when all services between the user call and the service handling the information are separate services, to ensure no access from other tenants.

Configuration

The challenge with configuration is, that it is often loaded with service start-up. One possibility is to not use the native configuration logic, and load all configurations from the tenant database/data when accessed. Another possibility is to have a configuration map loaded.

Some service-wide settings, like the port, TLS headers, or such parameters can only be configured per service, in this case, a multi-service approach should be verified, as described before.

Logging

Each tenant-specific logging must have the tenant reference in the metadata.

In a service-oriented environment, central logging should always be established for SIEM and general Audit overview. So the possibility of filtering all logs for a specific tenant exists.

Software Software design authentication Data (computing)

Published at DZone with permission of Fabian Lemke. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Data Encryption Is the First Line of Defense Against Identity Theft and Cybercrime
  • The Impact of Biometric Authentication on User Privacy and the Role of Blockchain in Preserving Secure Data
  • A Guide to Vector Embeddings for Product and Software Engineers
  • The Role of Zero-Knowledge Proofs in LLM Chains for Data Privacy

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: