MICROSERVICES

LET'S BUILD TOGETHER

http://rockalabs.com

xergioalex

Sergio A. Florez

TECH LEAD && FULL STACK DEVELOPER

LET'S BUILD TOGETHER

DIVIDE AND CONQUER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

DIVIDE AND CONQUER

LET'S BUILD TOGETHER

Microservice is that it does one thing and it does it very well.

LET'S BUILD TOGETHER

It’s autonomous: self-contained unit of functionality. A unique location (URL) identifies it.

LET'S BUILD TOGETHER

It’s isolated, so we can modify it, test it and deploy it without impacting other areas of the solution

LET'S BUILD TOGETHER

It’s elastic. Can be scaled independently of other services.

Vertical

Escaling

Horizontal

Escaling

LET'S BUILD TOGETHER

It’s resilient. Is fault tolerant and highly available.

LET'S BUILD TOGETHER

It’s responsive,  it responds to requests in a reasonable amount of time.

LET'S BUILD TOGETHER

It’s message oriented. Rely on asynchronous message-passing to establish a boundary between components.

LET'S BUILD TOGETHER

It’s programmable. Thanks to API’s for access by developers and administrators and Applications are composed from multiple microservices.

LET'S BUILD TOGETHER

It’s automated, the lifecycle of a microservice is managed through automation that includes dev, build, test, staging, production and distribution.

LET'S BUILD TOGETHER

Are Microservices the silver bullet for all your problems?

NO

LET'S BUILD TOGETHER

Scalable

PROS

CONS

Network latency increased by the messages interchange.

Reduce deployment costs

Deployment and testing complexity increase exponentially based on the number of interaction between services.

LET'S BUILD TOGETHER

Can be developed by a small team.

PROS

CONS

Too fine grained microservices may create an overhead that outweighs its utility.

Team only has to be aware of the business logic that represents the service and its interactions.

Message formats, restrictions, and interactions knowledge is needed.

LET'S BUILD TOGETHER

Continuous deployment.

PROS

CONS

Must pay lot of attention in versioning because of the interaction with older version of other services.

Use the technology you prefer to create it.

Transactional operations that goes through the boundaries of many microservices increase the logic complexity.

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

ARE YOU A HIPSTER?

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

LET'S BUILD TOGETHER

REST?

LET'S BUILD TOGETHER

It was created by Facebook in 2012, driven by the mobile team

The beginning

LET'S BUILD TOGETHER

GraphQL Especificación

(http://facebook.github.io/graphql/October2016/)



Implementación de referencia en js:

https://github.com/graphql/graphql-js

The beginning

LET'S BUILD TOGETHER

Graphql is query language designed to communicate clients and servers.

A complete alternative to REST.

What is it?

GraphQL is not like SQL.

LET'S BUILD TOGETHER

Platform agnostic (implemented in 20 languages)

What is it?

LET'S BUILD TOGETHER

It's just a convention

{REST}

VS

It is a typed language

The server exposes

resources.

The client defines

what receives

Usually send more

information than necessary.

Only what is necessary

is sent

LET'S BUILD TOGETHER

Multiple requests per

view or custom

{REST}

VS

One request per view

Documentation foreign to development.

Documented by

definition.

LET'S BUILD TOGETHER

Only one endpoint is required

/graphql

{REST}

VS

Multiples endpoints exposed

/puppies

/puppies/:id

/puppies/update/:id

/puppies/delete/:id

LET'S BUILD TOGETHER

Schema

LET'S BUILD TOGETHER

Types

LET'S BUILD TOGETHER

Mutations

Querys

LET'S BUILD TOGETHER

Resolvers

LET'S BUILD TOGETHER

Example

Links

 

LET'S BUILD TOGETHER

Por qué API REST está muerto y debemos usar APIs GraphQL - José María Rodríguez Hurtado

https://www.youtube.com/watch?v=cUIhcgtMvGc

 

Por qué API REST está muerto - José María Rodríguez

https://angel.co/blockchains

 

Cheatsheet

https://raw.githubusercontent.com/sogko/graphql-shorthand-notation-cheat-sheet/master/graphql-shorthand-notation-cheat-sheet.png

 

Links

 

LET'S BUILD TOGETHER

Links

 

LET'S BUILD TOGETHER

Links

 

LET'S BUILD TOGETHER

Links

 

LET'S BUILD TOGETHER

Links

 

LET'S BUILD TOGETHER

Links

 

LET'S BUILD TOGETHER

Divide and conquer – The Microservice approach

https://www.art2link.com/divide-conquer-microservice-approach/

 

Docker Load Balancer Demo

https://github.com/xergioalex/docker-load-balancer

LET'S BUILD TOGETHER

http://rockalabs.com

xergioalex

Sergio A. Florez

TECH LEAD && FULL STACK DEVELOPER

Made with Slides.com