microservices architecture

32
Microservices Architecture Ram Vijapurapu ~ @rvijapurapu

Upload: ram-vijapurapu

Post on 11-Apr-2017

144 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Microservices Architecture

Microservices ArchitectureRam Vijapurapu ~ @rvijapurapu

Page 2: Microservices Architecture

Agenda

2

Page 3: Microservices Architecture

*Terms & conditions apply.

3

Page 4: Microservices Architecture

4

Monolith

tl;dr ….

Microservice

Page 5: Microservices Architecture

The Quest for Modularity

5

Sales Inventory Admin

Web/shop /inventory /admin Mobile

Controllers (& Services)shopSvc inventorySvc adminSvc

DAOs

Security Framework

NAPPY_SITE_DB

Page 6: Microservices Architecture

What if?

6

Web/sales /inventory /admin Mobile

Controllers (& Services)shopSvc inventorySvc adminSvc

DAOs

Security Framework

IoT

Controllers (& Services)shopSvc inventorySvc adminSvc

buttonOrderSvc

BIG_F$_SITE_DB

Page 7: Microservices Architecture

What if?

7

Web/sales /inventory /admin Mobile

Controllers (& Services)shopSvc inventorySvc adminSvc

DAOs

Security Framework

IoT

Controllers (& Services)shopSvc inventorySvc adminSvc

buttonOrderSvc

BIG_F$_SITE_DB

Page 8: Microservices Architecture

Something has to change….

8

Micro ervicesto the rescue….

By Source, Fair use, https://en.wikipedia.org/w/index.php?curid=45003610

Page 9: Microservices Architecture

Is Microservices the new Hype?

9

Page 10: Microservices Architecture

https://de.wikipedia.org/wiki/Datei:Back-to-the-future-logo.svg10

Page 11: Microservices Architecture

Let’s start at the very beginning“Even though the UNIX system introduces a number of innovative programs and

techniques, no single program or idea makes it work well. Instead, what makes it

effective is the approach to programming, a philosophy of using the computer.

Although that philosophy can’t be written down in a single sentence, at its heart is the

idea that the power of a system comes more from the

relationships among programs than from the

programs themselves. Many UNIX programs do quite trivial things in

isolation, but, combined with other programs, become general and useful tools.”

– Brian Kernighan and Rob Pike, The UNIX Programming Environment

11

Page 12: Microservices Architecture

Let’s start at the very beginning

Write programs that do one

thing and do it well. Write

programs to work together. Write

programs to handle text streams, because that is a universal interface.

- Doug McIlroy, the inventor of Unix pipes

Read More: The Art of Unix Programming http://www.catb.org/~esr/writings/taoup/html/index.html 12

Page 13: Microservices Architecture

Whatever that means...

13

Page 14: Microservices Architecture

14

So the secret ingredient is?

…..Data

Page 15: Microservices Architecture

Flow Based Programming….

15

Page 16: Microservices Architecture

Flow Based Programming….

16

Flow-based programming (FBP) is a programming

paradigm that defines applications as networks of

"black box" processes, which exchange data across

predefined connections by message passing, where

the connections are specified externally to the

processes.

Page 17: Microservices Architecture

Microservices in the wild….

17

● Intents● Activities● Services● Broadcast Receivers● Listeners

Page 18: Microservices Architecture

Microservices in the wild….

18

Page 19: Microservices Architecture

Just give me a definition, will ya!

The microservice architectural style is an approach to developing a

single application as a suite of small

services, each running in its own process and communicating with lightweight

mechanisms, often an HTTP resource API. These services are built around business

capabilities and independently deployable by fully automated deployment machinery.

There is a bare minimum of centralized management of these services, which may be

written in different programming languages and use different data storage

technologies. - James Lewis & Martin Fowler

Read More: Microservices a definition of this new architectural term http://martinfowler.com/articles/microservices.html 19

Page 20: Microservices Architecture

Isn’t that what SOA is?

20

YesNO!

Maybe

Page 21: Microservices Architecture

Let’s backup a bit….

21

Sales Inventory Admin

Web/sales /inventory /admin Mobile

Controllers (& Services)shopSvc inventorySvc adminSvc

DAOs

Security Framework

Page 22: Microservices Architecture

Building Castles

22

Sales

/shop

SalesSvc

Shop DAO

Security

Inventory

/inventory

InventorySvc

Inventory DAO

Security

Admin

/admin

AdminSvc

Admin DAO

Security

Page 23: Microservices Architecture

The focus will be on communication

23

Sales

/shop

SalesSvc

Shop DAO

Security

Inventory

/inventory

InventorySvc

Inventory DAO

Security

Admin

/admin

AdminSvc

Admin DAO

Security

Page 24: Microservices Architecture

The focus will be on communication

24

Shop

/shop

SalesSvc

Shop DAO

Security

Inventory

/inventory

InventorySvc

Inventory DAO

Security

Admin

/admin

AdminSvc

Admin DAO

Security

Page 25: Microservices Architecture

API First

25

Page 26: Microservices Architecture

Takes two to tango

26

REST

ATTR: Ginny Huo, "Pass the Message," Copyright 2016. http://www.ginnyhuo.com/pass-the-message/

Message Queues

Page 27: Microservices Architecture

Sync vs Async

27

Page 28: Microservices Architecture

So, are we just going to run one instance of each???

28

Shop

/shop

SalesSvc

Shop DAO

Security

Inventory

/inventory

InventorySvc

Inventory DAO

Security

Admin

/admin

AdminSvc

Admin DAO

Security

Page 29: Microservices Architecture

Docker

29

Page 30: Microservices Architecture

Containers

30

Shop

Inventory

Admin

/shop

/inventory

/admin

Page 31: Microservices Architecture

31

Page 32: Microservices Architecture

32

Enough talk, ….

Kung Fu Panda (2008) - http://www.imdb.com/title/tt0441773/