Search code examples
componentsumlanalysisdiagram

Database in component diagram


I know that Component Diagram represents the architecture of some information system or the overall system, so it's necessary to mention the components that represent external databases used by the system.

My question is:

What if the application uses an internal database that lays on the same computer where the application is. Should it be represented as a separate component or a component with the system name is enough with its interfaces?


Solution

  • It depends what do you want to show on the diagram.

    If you're focusing on detailed application architecture you still might want to show database as a separate component (since that's what it is in reality).

    If your goal is to show application decomposition you can probably completely omit the database in the diagram. That's valid especially if your queries are embedded into the application layer other than database itself. If you have a dedicated database code (do database offers some sort of API to the component) you'd usually always represent that as a separate component.

    The actual location of a component is irrelevant on a component diagram. It's natural that some components share the same execution environment.