servers
Like PaaS
“If your PaaS can efficiently start instances in 20ms that run for
half a second, then call it serverless.”
Adrian Cockcroft - VP Cloud Architecture Strategy AWS
So, Containers?
Keep It Small and Simple
URL Minification
GET minified URL redirect
CREATE minified URL
QueriesCommands
Segregate all the Responsibilities
CosmosDB
Oh yeah!
Web App CosmosDB
CosmosDB
GET
POST
CosmosDB
GET
POST
Azure cache
UPDATE Change
Feed
CosmosDB
GET
POST
Azure cache
UPDATE
Change
Feed
Queue TRIGGER
Bindings & Triggers
"bindings": [
{
"type": "httpTrigger",
"route": "{slug}",
"methods": [
"get"
],
"authLevel": "anonymous",
"name": "req"
}
],
Function, User, System & Admin
"bindings": [
{
"name": "minifiedUrl",
"type": "documentDB",
"databaseName": "MinifyRepository",
"collectionName": "MinifiedUrls",
"createIfNotExists": true,
"connection": "CosmosDbConnection",
"direction": "out"
}
],
Don’t write JSON
Where to put the code
private readonly ICosmosClient cosmosClient;
public CreateUrlHandler()
{
this.cosmosClient = new CosmosClient();
}
public CreateUrlHandler(ICosmosClient cosmosClient)
{
this.cosmosClient = cosmosClient;
}
CosmosDB
GET
POST
Azure cache
UPDATE
Change
Feed
Queue TRIGGER
https://m.jdv.li/api/minifiedurl
or
https://m.jdv.li/minifiedurl
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"getminifiedredirect": {
"matchCondition": {
"methods": [ "GET" ],
"route": "/{slug}"
},
"backendUri": "https://%WEBSITE_HOSTNAME%/api/{slug}"
}
}
}
Matching conditions
https://github.com/Jandev/minifier
@Jan_de_V
jandv@4dotnet.nl
https://jan-v.nl

Creating real life serverless solutions with Azure Functions