---
# System prepended metadata

title: API Gateway Day III

---

# API Gateway Day III

---


* It is an endpoint that we choose and expose our applicaiton API's 
* it is serverless


![](https://i.imgur.com/c2YXq8V.png)

## Endpoint type
* API Gateway default endpoint is set only to a specified region
* we can update it to set as edge-optimized (sets the endpoint to every edge region)
* private


![](https://i.imgur.com/XpvdZhu.png)


## Step function

* step function is useful for running a long time taking process
* exe: payment process on amazon
* step function max workflow time is set to 365 days




![](https://i.imgur.com/rAQIpIm.png)

Here is an example of a Pass state that injects some fixed data into the state machine, probably for testing purposes.
```json
"No-op": {
    "Type": "Pass", 
    "Result": { 
        "x-datum": 0.381018,
        "y-datum": 622.2269926397355 
        },
    "ResultPath": "$.coords",
    "Next": "End"
}
```
* A Choice state ("Type": "Choice") adds branching logic to a state machine. A Choice state must have a Choices field whose value is a non-empty array, whose every element is an object called a Choice Rule. A Choice Rule contains the following: 


*  A comparison – Two fields that specify an input variable to compared, the type of comparison, and the value to compare the variable to.
* A Next field – The value of this field must match a state name in the state machine.
* The following example checks whether the numerical value is equal to 1: 
```json
{
"Variable": "$.foo", 
"NumericEquals": 1,
"Next": "FirstMatchState" 
}
```

* The Parallel state ("Type": "Parallel") can be used to create parallel branches of execution in your state machine.
* A Parallel state causes AWS Step Functions to execute each branch, starting with the state named in that branch's StartAt field, as concurrently as possible, and wait until all branches terminate (reach a terminal state) before processing the Parallel state's Next field.

```json
"LookupCustomerInfo": { "Type": "Parallel", "Branches": [ { "StartAt": "LookupAddress", "States": {
"LookupAddress": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:123456789012:function:AddressFinder", "End": true } } }, { "StartAt":
"LookupPhone", "States": { "LookupPhone": { "Type": "Task", "Resource":
"arn:aws:lambda:us-east-1:123456789012:function:PhoneFinder", "End": true } } } ],
"Next": "NextState" } "Next": "NextState" }
```



## ElastiCache

---


![](https://i.imgur.com/ycd4f6k.png)



* Multi-threaded performance There is no longer a build-time distinction between a single-threaded and multi-threaded memcached.
*  If you want a single-threaded memcached, ask for one thread. 
*  This change lets us focus on a future where multiple cores can be saturated for servicing requests.

