23
DOCKER, NODE.JS, REDIS MICRO EVERYTHING T @SEGALDORON G DORON2402/DOCKER-NODEJS-REDIS

microservice

Embed Size (px)

Citation preview

Page 1: microservice

DOCKER, NODE.JS, REDISMICRO EVERYTHING

T @SEGALDORON G DORON2402/DOCKER-NODEJS-REDIS

Page 2: microservice

A LITTLE BIT OF HISTORY…

Page 3: microservice

YOU NEED… PHP 3, MYSQL,IPTABLES, ETC..

And your web server is ready!

EARLY 2000

Page 4: microservice

AND THEN… THE HYPERVISOR

Page 5: microservice

YOU CAN RUN VIRTUAL SERVER

MID 2000

Page 6: microservice

AND THEN…

Page 7: microservice

CONTAINERS!!!

Page 8: microservice

DOCKER

HOW DOCKER CHANGE THE WORLD

▸ Deployment

▸ Scaling

▸ Thinking in microsite

▸ Debugging

▸ Shipping

▸ Discovering

Page 9: microservice

USING ONE OPERATION SYSTEM NO HYPERVISOR

TODAY 2016

Page 10: microservice

A GAME CHANGER?

Page 11: microservice

RUNNING DOCKER MULTI PLATFORM…

FUTURE/PRESENT

Page 12: microservice

THE OLD WAY

MONOLITHIC APPLICATION

▸ Lots of engineers work on the same code base

▸ Scary deployment (all eggs in one basket)

▸ One thing doing too many things

▸ Hard to debug

▸ Scaling?!

Page 13: microservice

WELCOME TO THE FUTURE

MICRO SERVICE ARCHITECTURE

▸ Smaller code base

▸ Smaller team

▸ Fast & Small deployment

▸ Each service solve a specific problem

▸ Stateless

▸ Product VS Services

▸ Async Services

Page 14: microservice

MONOLITHIC APPLICATION VS MICROSERVICES

EX’ - LETS ADD FOLLOW BUTTON TO A RESTAURANT PAGE

Page 15: microservice

MONOLITHIC APPLICATION VS MICROSERVICES

EX’ - LETS ADD FOLLOW BUTTON TO A RESTAURANT PAGE

▸ Monolithic App

▸ Create new dir

▸ Adding bunch of code

▸ Add the routes

▸ Micro Service

▸ Creating new service

▸ Routing traffic to our service

▸ [POST] /users/:id/follow/:id

▸ [DELETE] /users/:id/follow/:id

▸ [GET] /users/:id/follow/:id

Page 16: microservice

MONOLITHIC APPLICATION VS MICROSERVICES

OH NO WE HAVE A BUG?!?

Page 17: microservice

MONOLITHIC APPLICATION

LETS TRY TO FIND THE BUG?!?

▸ Most importantly our site is DOWN!!

Page 18: microservice

MICROSERVICES

OUR SITE IS STILL UP

▸ Worse case scenario our `follow` button is missing or not saving the state after refresh

Page 19: microservice

DEMO

NOW THAT WE UNDERSTAND WHY MICRO SERVICE IS THE WAY TO GO LETS DEMO

Page 20: microservice

DEMO

OLD SITE COUNTER?

artists

Page 21: microservice

DEMO - COUNTER

[POST] /counterClient

ClientServer

Increment

Server

Decrement

Redis

In this example the communication is sync I would recommend using async

[GET] /counter

Page 22: microservice

THANK YOU!

THE KEYS ARE - ISOLATION - IMMUTABILITY

Page 23: microservice

THANK YOU!

IF YOU CAN’T THINK ABOUT ANY QUESTION PING ME LATER ON TWITTER @SEGALDORON

YOU CAN ALSO FIND THE CODE HERE: HTTPS://GITHUB.COM/DORON2402/DOCKER-NODEJS-REDIS

SLIDESHOW AND LINKS WILL BE POST ON THE MEETUP PAGE

THANK YOU!