dia_db_cluster.py 1.1 KB

123456789101112131415161718192021222324252627282930
  1. from diagrams import Cluster, Diagram, Edge
  2. from diagrams.onprem.database import Mariadb
  3. from diagrams.azure.database import DatabaseForMariadbServers
  4. from diagrams.onprem.inmemory import Redis
  5. from diagrams.onprem.groupware import Nextcloud
  6. from diagrams.custom import Custom
  7. with Diagram(filename="./assets/dia_db_cluster", show=False):
  8. nc = Nextcloud()
  9. with Cluster("Database cluster"):
  10. with Cluster("Load balancer"):
  11. paSQL = Custom("ProxySQL Active", "../assets/proxysql.png")
  12. ppSQL = Custom("ProxySQL Passive", "../assets/proxysql.png")
  13. with Cluster("Galera cluster"):
  14. bckp1 = DatabaseForMariadbServers("Backup writer")
  15. primary = Mariadb("Primary writer")
  16. bckp2 = DatabaseForMariadbServers("Backup writer")
  17. paSQL - Edge(color="firebrick") - primary
  18. bckp1 - Edge(style="dashed") - paSQL - Edge(style="dashed") - bckp2
  19. ppSQL - Edge(color="firebrick") - primary
  20. bckp1 - Edge(style="dashed") - ppSQL - Edge(style="dashed") - bckp2
  21. paSQL << nc >> ppSQL