Search code examples
databaseauthenticationdocumentationdiagramc4-model

Is a cloud database or authentication services considered an outside factor? (C4 Model)


This is my issue: I'm trying out creating an C4 Model for my personal project and it got me thinking if cloud databases like MongoDB Atlas or authentication services like Auth0 are considered an outside factor? I made an example:

Inside the container Inside the container

Outside of the container (External factor) Outside of the container (External factor)

Am I correct in assume that these systems like cloud database are outside factors that my system interacts with? I'm not deploying a database, I'm using their system, correct? Same for Auth0 and stuff. So I should put them outside, like the authors... Or no?


Solution

  • From the c4model.com FAQ...

    Should data storage services be shown as software systems or containers?

    A frequently asked question is whether services like Amazon S3, Amazon RDS, Azure SQL Database, content delivery networks, etc should be shown as software systems or containers. After all, these are external services that most of us don’t own or run ourselves.

    If you’re building a software system that is using Amazon S3 for storing data, it’s true that you don’t run S3 yourself, but you do have ownership and responsibility for the buckets you are using. Similarly with Amazon RDS, you have (more or less) complete control over any database schemas that you create. For this reason, treat them as containers because they are an integral part of your software architecture, although they are hosted elsewhere.

    So, for Atlas, I'd model that as a container inside your software system. Auth0 I would usually model as an external software system.