Data

Shared Database Pattern

Description

Multiple services access the same database. This is generally considered an anti-pattern in microservices but is common in brownfield projects.

Where to use

  • Simple applications.
  • \n
  • Transitional phase during migration.

Real World Example

Order Service and Customer Service both read tables from the same Oracle instance.

Code Example

class SharedDatabasePattern:\n    def __init__(self):\n        pass\n\n    def execute(self):\n        print('Executing Shared Database Pattern')