Slide 1

Slide 1 text

Elastic APIs Are microservices the answer? [email protected] 
 @orliesaurus

Slide 2

Slide 2 text

My name is.. • Im here to help you build stuff

Slide 3

Slide 3 text

Microservices Everyone is talking about this topic, everyone is trying to take a bite.
 P.S. They have their own instagram.com/microservices account

Slide 4

Slide 4 text

The inspiration • Driven From Blueprints • Isolated Resources • Run Anywhere LOL

Slide 5

Slide 5 text

Containers are A THING • Have been around since `chroot` • Became a global trend shortly after the release of Docker the 2013-03-23

Slide 6

Slide 6 text

Docker interest over time

Slide 7

Slide 7 text

–Every engineer in a social situation “Oh yeah.. we’re using containers…”

Slide 8

Slide 8 text

Independence === pizza:

Slide 9

Slide 9 text

Qualities of microservices • Deal with problems inside their scope • Data sharing per service • Available • Versioning • Auto-deployable

Slide 10

Slide 10 text

//Assume you have an .env file
 var express = require('express'); var http = require('http'); var mongo = require('mongodb').MongoClient; var app = express(); app.set('port', process.env.PORT || 8080); var mongodb; if(process.env.MONGO_URL) { mongo.connect(process.env.MONGO_URL, null, function(err, mongodb_) { if(err) { console.log(err); } else { mongodb = mongodb_; } }); } app.get('/users', function(req, res, next) { var collection = db.collection('users'); collection.find().toArray(function(err, result) { if(err) { res.sendStatus(500); return; } res.json(result); }); }); app.listen(app.get('port')); Retrieve all users

Slide 11

Slide 11 text

INTRODUCING: THE GATEWAY…

Slide 12

Slide 12 text

• Authentication

Slide 13

Slide 13 text

• Security (transport layer)

Slide 14

Slide 14 text

• Load Balancing

Slide 15

Slide 15 text

• Request Dispatching

Slide 16

Slide 16 text

Example: You wanna buy some

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

⚠ ALL THAT! BAY LIFE

Slide 19

Slide 19 text

λ

Slide 20

Slide 20 text

λ!

Slide 21

Slide 21 text

• Own code + Libraries • Native SDK • Timeouts and Memory • Use external storage, there’s no root access! • Debug via cloudwatch

Slide 22

Slide 22 text

• Invoke through Gateway, or other services

Slide 23

Slide 23 text

λ G
 A
 T
 E
 W
 A
 Y /route λ λ λ λ GET PUT POST DELETE PATCH

Slide 24

Slide 24 text

https://github.com/awslabs/aws-apigateway- importer

Slide 25

Slide 25 text

console.log('Loading function'); exports.handler = function(event, context) { //YOUR CODE GOES HERE context.succeed(“Hurray”); context.fail(‘oh no :( :(‘); };

Slide 26

Slide 26 text

swagger: '2.0' info: version: '1.0.0' title: Swagger Petstore description: A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification termsOfService: http://helloreverb.com/terms/ contact: name: Swagger API team email: [email protected]

Slide 27

Slide 27 text

– Startup guy “2easy4me” ./aws-api-import.sh --create path/to/swagger.json

Slide 28

Slide 28 text

–Johnny Appleseed “Type a quote here.”

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

– (Maybe) A guy employed by Amazon who worked on Lambda It’s Superfast, like Rambo driving a Lambo TEST IT: squirrelbin.com

Slide 32

Slide 32 text

TRY, FAIL, LEARN, DISCUSS [email protected] 
 @orliesaurus