<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Backend on Commentary of Takao</title><link>https://takao.blog/zh/tags/backend/</link><description>Recent content in Backend on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>zh</language><copyright>Commentary of Takao</copyright><lastBuildDate>Wed, 15 Jul 2026 22:01:08 +0900</lastBuildDate><atom:link href="https://takao.blog/zh/tags/backend/index.xml" rel="self" type="application/rss+xml"/><item><title>设计 REST API 端点的最佳实践</title><link>https://takao.blog/zh/web/web-api-design-rest-best-practices/</link><pubDate>Fri, 25 Apr 2025 00:00:00 +0900</pubDate><guid>https://takao.blog/zh/web/web-api-design-rest-best-practices/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/web-api-design-rest-best-practices-zh.png" alt="Featured image of post 设计 REST API 端点的最佳实践" /&gt;&lt;h2 id="介绍"&gt;介绍
&lt;/h2&gt;&lt;p&gt;在现代 Web 开发中，&lt;strong&gt;API 一致性&lt;/strong&gt;对于开发人员的生产力起着至关重要的作用。&lt;/p&gt;
&lt;p&gt;不一致的端点 (URL)、不正确的 HTTP 方法以及将所有错误包装在 &lt;code&gt;200 OK&lt;/code&gt; 状态代码中会导致混乱、错误和浪费的开发周期。&lt;/p&gt;</description></item><item><title>API速率限制</title><link>https://takao.blog/zh/web/api-rate-limiting/</link><pubDate>Tue, 07 May 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/zh/web/api-rate-limiting/</guid><description>&lt;img src="https://takao.blog/img/thumbnail/api-rate-limiting-zh.png" alt="Featured image of post API速率限制" /&gt;&lt;p&gt;Rate limiting is a critical component of any production API. It protects backend services from abuse, ensures fair resource allocation, maintains performance under load, and mitigates denial-of-service attacks. This article examines the major rate limiting algorithms, their trade-offs, and best practices for designing robust systems.&lt;/p&gt;
&lt;h2 id="token-bucket-algorithm"&gt;Token Bucket Algorithm
&lt;/h2&gt;&lt;p&gt;The token bucket is one of the most widely used rate limiting algorithms. A bucket holds tokens that refill at a steady rate, and each request consumes one token. If the bucket is empty, the request is denied. This approach allows bursts up to the bucket capacity while smoothing traffic over time.&lt;/p&gt;</description></item></channel></rss>