# Architecture Articles

> Articles about Architecture from Dodo Payments, including guides, insights, and best practices.

- **URL**: https://dodopayments.com/blogs/category/architecture

---

- [Hosted vs Self-Hosted Payment Gateway: Which Is Right for Your SaaS?](https://dodopayments.com/blogs/hosted-vs-self-hosted-payment-gateway): Hosted vs self-hosted payment gateway compared. PCI scope, control, integration speed, and which model fits SMB SaaS, enterprise, and global product-led companies.
- [OpenAI Style Usage Limits: Implementing Customer Quotas in Your Product](https://dodopayments.com/blogs/openai-usage-limits-customer-quotas): How to implement customer facing usage limits and quotas in your AI product. Soft caps, hard caps, alerts, and the OpenAI style limit experience.
- [Real-Time Streaming Usage Metering for SaaS and AI Products](https://dodopayments.com/blogs/real-time-streaming-usage-metering): Build a real-time streaming usage metering pipeline that supports live dashboards, hard caps, and instant overage. Architecture and pitfalls.
- [Billing API Gateway Calls: Architecture for API as a Service](https://dodopayments.com/blogs/billing-api-gateway-calls-architecture): Build a metering pipeline that bills API calls accurately at high volume. Architecture, batching, and pitfalls for API as a service products.
- [Metering Object Storage and S3 Billing for SaaS](https://dodopayments.com/blogs/metering-object-storage-s3-billing): Bill customers for storage uploads, capacity, and bandwidth across S3, GCS, and Azure Blob. Architecture for accurate object storage metering.
- [Metering LLM Token Usage: An Architecture Guide for AI SaaS](https://dodopayments.com/blogs/metering-llm-token-usage-architecture): Build a metering pipeline for LLM token usage that survives retries, supports multiple providers, and feeds clean billing events. Architecture and pitfalls.
- [Multi-Tenant Billing Architecture: Design Patterns for SaaS](https://dodopayments.com/blogs/multi-tenant-billing-architecture): Design patterns for building multi-tenant billing systems in SaaS. Covers tenant isolation, metering, event-driven billing, and when to build vs buy billing infrastructure.

---

**Dodo Payments** -- The billing & payments platform for AI-first companies.
[Payments](https://dodopayments.com/payments) | [Billing](https://dodopayments.com/billing) | [Distribution](https://dodopayments.com/distribution) | [Pricing](https://dodopayments.com/pricing) | [Documentation](https://docs.dodopayments.com) | [Dashboard](https://app.dodopayments.com)