<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Best-Practices on Pavan Yara</title><link>https://pavanyara.com/tags/best-practices/</link><description>Recent content in Best-Practices on Pavan Yara</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><managingEditor>pavan.yara@gmail.com (Pavan Yara)</managingEditor><webMaster>pavan.yara@gmail.com (Pavan Yara)</webMaster><copyright>Pavan Yara</copyright><lastBuildDate>Wed, 18 Dec 2019 22:21:54 +0530</lastBuildDate><atom:link href="https://pavanyara.com/tags/best-practices/index.xml" rel="self" type="application/rss+xml"/><item><title>Notes on API Practices</title><link>https://pavanyara.com/blog/api-practices-1/</link><pubDate>Wed, 18 Dec 2019 22:21:54 +0530</pubDate><author>pavan.yara@gmail.com (Pavan Yara)</author><guid>https://pavanyara.com/blog/api-practices-1/</guid><description>&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Technique&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Treat customers with disdain&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Show customers love&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Don&amp;rsquo;t have an API&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Have an API&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Make signups difficult, users must justify their request&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Self-service onboarding&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;3&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Exorbitant fees for the privilege of API access&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Enable API access for free or as part of an &amp;ldquo;enterprise-level&amp;rdquo; package&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;4&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;API documentation behind login page or otherwise hidden from search engines&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;API documentation freely accessible and referenced by public search engines&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;5&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Use a proprietary or terrible protocol&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Use an industry-standard protocol such as JSON:API or gRPC (&lt;a href="https://grpc.io"&gt;https://grpc.io&lt;/a&gt;)&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;6&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Permit only one API key&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Permit multiple API keys for each rotation&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;7&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Tempt fate by maintaining documentation manually&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Keep documentation in sync with code using automated systems such as Swagger or gRPC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;8&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Ignore the infrastructure as code (IaC) revolution&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Make IaC a top priority: Provide officially supported modules for Terraform, Chef, Puppet, Chocolatey, and similar systems&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;9&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Design APIs to be non-idempotent whenever possible&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Design APIs to be idempotent whenever possible&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;via Thomas A. Limoncelli&amp;rsquo;s excellent &lt;a href="https://queue.acm.org/detail.cfm?id=3375635"&gt;ACM queue column on APIs&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;</description><content:encoded><![CDATA[<table>
	<thead>
			<tr>
					<th>Technique</th>
					<th>Treat customers with disdain</th>
					<th>Show customers love</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1</td>
					<td>Don&rsquo;t have an API</td>
					<td>Have an API</td>
			</tr>
			<tr>
					<td>2</td>
					<td>Make signups difficult, users must justify their request</td>
					<td>Self-service onboarding</td>
			</tr>
			<tr>
					<td>3</td>
					<td>Exorbitant fees for the privilege of API access</td>
					<td>Enable API access for free or as part of an &ldquo;enterprise-level&rdquo; package</td>
			</tr>
			<tr>
					<td>4</td>
					<td>API documentation behind login page or otherwise hidden from search engines</td>
					<td>API documentation freely accessible and referenced by public search engines</td>
			</tr>
			<tr>
					<td>5</td>
					<td>Use a proprietary or terrible protocol</td>
					<td>Use an industry-standard protocol such as JSON:API or gRPC (<a href="https://grpc.io">https://grpc.io</a>)</td>
			</tr>
			<tr>
					<td>6</td>
					<td>Permit only one API key</td>
					<td>Permit multiple API keys for each rotation</td>
			</tr>
			<tr>
					<td>7</td>
					<td>Tempt fate by maintaining documentation manually</td>
					<td>Keep documentation in sync with code using automated systems such as Swagger or gRPC</td>
			</tr>
			<tr>
					<td>8</td>
					<td>Ignore the infrastructure as code (IaC) revolution</td>
					<td>Make IaC a top priority: Provide officially supported modules for Terraform, Chef, Puppet, Chocolatey, and similar systems</td>
			</tr>
			<tr>
					<td>9</td>
					<td>Design APIs to be non-idempotent whenever possible</td>
					<td>Design APIs to be idempotent whenever possible</td>
			</tr>
	</tbody>
</table>
<ul>
<li>via Thomas A. Limoncelli&rsquo;s excellent <a href="https://queue.acm.org/detail.cfm?id=3375635">ACM queue column on APIs</a></li>
</ul>
]]></content:encoded></item></channel></rss>