|AWS region code||AWS region name||Number of AZs||AZ names|
|us-east-1||Virginia||4||us-east-1a, us-east-1b, us-east-1c, us-east-1e|
|us-west-1||N. California||2||us-west-1a, us-west-1b|
|us-west-2||Oregon||3||us-west-2a, us-west-2b, us-west-2c|
|eu-west-1||Ireland||3||eu-west-1a, eu-west-1b, eu-west-1c|
|ap-southeast-2||Sydney||2||ap-southeast-2a, ap-southeast-2b, ap-southeast-2c|
Scaling your API with rate limiters
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
Request rate limiter
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
At the moment GraphQL allows 2 types of queries:
Reference implementation also adds the third type:
subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
|#! /usr/bin/env node|
|// I am ./bin/buildSitemap.js|
|const path = require('path')|
|const glob = require('glob')|
|const fs = require('fs')|
|const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com'|
|const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js')|
|const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml')|
Tutorial: Designing a GraphQL API
This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.
It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.