Mermaid
简单版本
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server01]
B --> D[Server02]复杂版本
flowchart TB
subgraph Client["客户端层"]
Web[Web App]
Mobile[Mobile App]
Desktop[Desktop App]
end
subgraph Gateway["API 网关层"]
Kong[Kong Gateway]
Auth[Auth Service]
RateLimit[Rate Limiter]
end
subgraph Services["微服务层"]
direction TB
subgraph Core["核心服务"]
UserSvc[User Service]
OrderSvc[Order Service]
ProductSvc[Product Service]
PaymentSvc[Payment Service]
end
subgraph Support["支撑服务"]
NotifySvc[Notification Service]
SearchSvc[Search Service]
AnalyticsSvc[Analytics Service]
end
end
subgraph Data["数据层"]
PostgreSQL[(PostgreSQL)]
MongoDB[(MongoDB)]
Redis[(Redis Cache)]
Elasticsearch[(Elasticsearch)]
end
subgraph MQ["消息队列"]
Kafka[Apache Kafka]
end
Web & Mobile & Desktop --> Kong
Kong --> Auth
Kong --> RateLimit
Auth --> UserSvc
Kong --> UserSvc & OrderSvc & ProductSvc & PaymentSvc
UserSvc --> PostgreSQL
OrderSvc --> PostgreSQL
ProductSvc --> MongoDB
PaymentSvc --> PostgreSQL
OrderSvc & PaymentSvc --> Kafka
Kafka --> NotifySvc & AnalyticsSvc
SearchSvc --> Elasticsearch
ProductSvc --> Redis
UserSvc --> Redis
style Kong fill:#e1f5fe
style Kafka fill:#fff3e0
style PostgreSQL fill:#e8f5e9
style Redis fill:#ffebeeLaTeX
$E=mc^2$
$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$$$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
复杂latex
\begin{aligned}
\nabla \times \vec{\mathbf{E}} &= -\frac{\partial \vec{\mathbf{B}}}{\partial t} \\
\nabla \times \vec{\mathbf{B}} &= \mu_0 \vec{\mathbf{J}} + \mu_0 \varepsilon_0 \frac{\partial \vec{\mathbf{E}}}{\partial t} \\[1em]
\hat{f}(\xi) &= \int_{-\infty}^{\infty} f(x) e^{-2\pi i x \xi} dx \\[1em]
\mathbf{A} &= \begin{pmatrix}
\frac{\partial^2 u}{\partial x^2} & \frac{\partial^2 u}{\partial x \partial y} & \cdots \\
\frac{\partial^2 u}{\partial y \partial x} & \frac{\partial^2 u}{\partial y^2} & \cdots \\
\vdots & \vdots & \ddots
\end{pmatrix} \\[1em]
\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} &= \ln(2) \quad \text{and} \quad \prod_{p \text{ prime}} \frac{1}{1-p^{-s}} = \zeta(s)
\end{aligned}