Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Psychology Of Color In UX Design And Digital Products

      August 15, 2025

      This week in AI dev tools: Claude Sonnet 4’s larger context window, ChatGPT updates, and more (August 15, 2025)

      August 15, 2025

      Sentry launches MCP monitoring tool

      August 14, 2025

      10 Benefits of Hiring a React.js Development Company (2025–2026 Edition)

      August 13, 2025

      Your smart home device just got a performance and security boost for free

      August 18, 2025

      Ultrahuman brings advanced cycle and ovulation tracking to its smart ring

      August 18, 2025

      DistroWatch Weekly, Issue 1135

      August 17, 2025

      14 secret phone codes that unlock hidden features on your Android and iPhone

      August 17, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Air Quality Prediction System using Python ML

      August 17, 2025
      Recent

      Air Quality Prediction System using Python ML

      August 17, 2025

      AI’s Hidden Thirst: The Water Behind Tech

      August 16, 2025

      Minesweeper game in 100 lines of pure JavaScript – easy tutorial

      August 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      DistroWatch Weekly, Issue 1135

      August 17, 2025
      Recent

      DistroWatch Weekly, Issue 1135

      August 17, 2025

      Ubuntu’s New “Dangerous” Daily Builds – What Are They?

      August 17, 2025

      gofmt – formats Go programs

      August 17, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Databases»Amazon DynamoDB data modeling for Multi-Tenancy – Part 1

    Amazon DynamoDB data modeling for Multi-Tenancy – Part 1

    May 17, 2025

    One reason that customers choose Amazon DynamoDB is because it provides single-digit millisecond performance on any scale. However, this performance depends on an effective data model that supports the application’s access patterns and concurrency requirements. Multi-tenant applications (such as Software-as-a-Service or SaaS applications) introduce additional complexity with unique considerations around performance, scalability, and isolation.

    In this series of posts, we walk through the process of creating a DynamoDB data model using an example multi-tenant application, a customer issue tracking service. The goal of this series is to explore areas that are important for decision-making and provide insights into the influences to help you plan your data model for a multi-tenant application.

    In this post, we define the access patterns and decide on the table design. In Part 2, we select a partition key design and create the data schema by iterating across the access patterns. Finally, in Part 3, we validate the data model and explore how to extend the model as new access patterns emerge.

    Considerations when designing a data model for multi-tenancy

    The primary goal when designing a data model is to make queries as efficient as possible whilst maintaining tenant isolation. An efficient data model optimizes cost, reduces waste, and ensures queries are performant. This helps your application scale as your tenants grow without causing significant costs or performance issues.

    The data partitioning and tenant isolation approaches you use, heavily influence your data model design. Depending on the deployment model you use, how you partition data and implement tenant isolation may differ. A silo model may not need a specific data partitioning approach, because the table belongs to the tenant. Similarly, you can implement tenant isolation at the table resource level using AWS Identity and Access Management (IAM).

    The pool model introduces more complexity because multiple tenants share the same DynamoDB table. You can partition data using a unique tenant identifier (tenantId) in the table’s partition key to associate the item with the tenant it belongs to. However, this introduces the constraint that your data model must include tenantId in all partition keys, which may exclude potential data patterns.

    This constraint has greater weight because you can also use tenantId as a data point to enforce tenant isolation. For example, you can implement fine-grained access control with IAM and attribute-based access control, using the dynamodb:LeadingKeys condition key to restrict permissions to only the items whose partition key matches the tenant’s identifier as passed in a session tag.

    Another consideration is whether you need to support multiple deployment models. It’s common to have silo and pool models within a multi-tenant solution. Besides different access patterns and tenant isolation mechanisms, supporting mechanisms (such as backup, metrics, metering, and tenant portability) may vary by model, increasing operational complexity.

    When using multiple partitioning strategies, it’s important to maintain a consistent data model. For example, when deploying silo tenants, you may use tenantId in the prefix to align with your pool model, even if this isn’t strictly required for isolation. A consistent data model across service tiers simplifies the application architecture, offers standardized data migration within and across tiers, and increases operational efficiencies by enabling single processes for operational activities like metrics gathering, scaling, and cost allocation.

    Regardless of the partitioning model, you need to implement operational monitoring to help maintain a consistent tenant experience as your application scales. For more details, see Monitoring Amazon DynamoDB for operational awareness.

    For this application, we have selected a pool deployment model. This means there is a single table for all tenant data and we implement isolation using IAM policies. This is important because to implement this, all the partition keys for the base table and global secondary indexes (GSIs) require tenantId as a prefix to use the LeadingKeys condition key. This is shown in Part 2.

    For multi-tenant applications, on-demand capacity mode is recommended as the default approach. This mode automatically handles varying workloads across multiple tenants without requiring capacity planning, and ensures that one tenant’s activity doesn’t impact others. Provisioned capacity mode should be considered as an optimization for predictable workloads.

    Defining access pattern entities

    Identifying your data access patterns is key to designing a successful data model. We start by defining the entities and attributes in our data model, then document our access patterns.

    In our example multi-tenant issue tracking application, we have the following entities and attributes:

    Ticket

    • TenantId – This is the customer (buyer) of our application. There are multiple tenants.
    • TicketId – This is an auto-generated unique identifier for each ticket.
    • Status – The current status of the ticket.
    • Created Date – The date the ticket was created.
    • Resolver – The current assigned resolver of the ticket.
    • Title – The title of the ticket
    • Created By – The user who raised the ticket

    Comment

    • CommentId – This is an auto-generated unique identifier for each comment.
    • Created Date – The date the comment was created
    • Created By – The user who added the comment

    The following figure shows this as a traditional entity-relationship diagram (ERD).

    Entity relationship diagram

    Documenting access patterns

    Now that you have modeled the entities, it’s time to document the access patterns. For simplicity, there are two personas in the application: a regular tenant user and a tenant admin user. Not all personas and access patterns may be known at this point.

    The following are the access patterns for our example application:

    • “As a user, I want to get a single ticket and all comments.”
    • “As a user, I want to view a single ticket summary.”
    • “As a user, I want to get all open tickets.”
    • “As a user, I want to view all open tickets for a given resolver.”
    • “As a user, I want to change the status of multiple tickets atomically.”
    • “As a tenant admin, I want to view an aggregate of the tickets by status in my tenant.”

    With the access patterns documented, to design the right data model, requirements such as frequency, requests per second, SLA, and consistency need to be collected for each access pattern. We document these requirements for the issue tracking application in the following table.

    Access PatternPeak Throughput (requests per second)FrequencyPriorityConsistency RequirementPersona
    As a user, I want to get a single ticket and all comments.50HourlyHighEventualUser
    As a user, I want to view a single ticket summary.100HourlyHighEventualUser
    As a user, I want to get all open tickets.25HourlyMediumEventualUser
    As a user, I want to view all open tickets for a given resolver.25HourlyHighStrongUser
    As a user, I want to change the status of multiple tickets atomically.5HourlyHighStrongUser
    As a tenant admin, I want to view an aggregate of the tickets by status in my tenant.10DailyLowEventualTenant Admin

    Table design for multi-tenant applications

    Choosing a table design is a non-trivial decision and should be carefully considered. Our goal is to create an efficient data model for cost and performance. With multi-tenancy, any wastage scales with the number of tenants, so efficiency becomes a priority.

    When choosing a table design, it’s important to work backwards from your access patterns and choose the best data model for your use case. Considerations for table design are covered in Data Modeling foundations in DynamoDB.

    If your access patterns lead you to a single-table design, then you should consider whether the cost and performance efficiencies of a single-table design outweigh the simplicity of a multi-table one. Single-table design is an advanced pattern and should not necessarily be the default approach.

    Conclusion

    Designing a performant DynamoDB data model for multi-tenant applications requires careful planning and analysis. By starting with the core entities and access patterns of your application, you can make informed decisions about partitioning, isolation strategies, and table structure. Defining these requirements per access pattern ahead of time helps make sure the table can scale as the application grows.

    To summarize the takeaways:

    • Start by defining the entities and entity relationships inside your data model
    • Document your access patterns
    • Maintain a consistent data model across different tenant partitioning models
    • Evaluate table design based on your application requirements

    In this post, we discussed the requirements for building a multi-tenant DynamoDB table. In Part 2, you will learn about data modeling and implementing the access patterns defined in this post. In Part 3, you’ll validate your data model and explore how to extend the model as new access patterns emerge.


    About the Authors

    Dave RobertsDave Roberts is a Senior Solutions Architect in the AWS SaaS Factory team where he helps software vendors to build SaaS and modernize their software delivery. Originally from Aotearoa, he now lives in Germany with a loving wife and two kids. Outside of SaaS, he enjoys hearing the birds sing and hiding Easter eggs in technical content.

    Josh "Hitman" HartJosh Hart is a Principal Solutions Architect at Amazon Web Services. He works with ISV customers in the UK to help them build and modernize their SaaS applications on AWS.

    Samaneh UtterSamaneh Utter is an Amazon DynamoDB Specialist Solutions Architect based in Göteborg, Sweden.

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleAmazon DynamoDB data modeling for Multi-Tenancy – Part 2
    Next Article LockBit Leak Reveals Details About Ransom Payments, Vulnerabilities and RaaS Operations

    Related Posts

    Artificial Intelligence

    Scaling Up Reinforcement Learning for Traffic Smoothing: A 100-AV Highway Deployment

    August 18, 2025
    Repurposing Protein Folding Models for Generation with Latent Diffusion
    Artificial Intelligence

    Repurposing Protein Folding Models for Generation with Latent Diffusion

    August 18, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-5114 – Easysoft Zentaopms Deserialization Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    I love Linux, so when Windows 10 reaches end of life you might be surprised when I don’t tell you to run to it with open arms

    News & Updates

    Sweden says it is under cyber attack

    Development

    IO Interactive’s James Bond game is titled 007 First Light, and it’s being revealed this week

    News & Updates

    Highlights

    CVE-2025-34025 – Versa Concerto Privilege Escalation and Container Escape Vulnerability

    May 22, 2025

    CVE ID : CVE-2025-34025

    Published : May 21, 2025, 11:15 p.m. | 3 hours, 35 minutes ago

    Description : The Versa Concerto SD-WAN orchestration platform is vulnerable to an privileges escalation and container escape vulnerability caused by unsafe default mounting of host binary paths that allow the container to modify host paths. The escape can be used to trigger remote code execution or direct host access depending on the host operating system configuration.This issue is known to affect Concerto from 12.1.2 through 12.2.0. Additional versions may be vulnerable.

    Severity: 0.0 | NA

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-7554 – Sapido RB-1802 Cross-Site Scripting Vulnerability

    July 14, 2025

    CVE-2025-4955 – Tarteaucitron.io WordPress Stored Cross-site Scripting Vulnerability

    June 18, 2025

    CVE-2025-5246 – Campcodes Online Hospital Management System SQL Injection

    May 27, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.