Slide 1

Slide 1 text

Using APIs for Microservices Antonis Kalipetis - @akalipetis www.SourceLair.com API Meetup 16/02/2015

Slide 2

Slide 2 text

–Wikipedia “In computing, microservices is a software architecture design pattern, in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs. These services are small, highly decoupled and focus on doing a small task.”

Slide 3

Slide 3 text

Importance of APIs • Language agnostic • Clearly define a way of communication • Do not “care” about internal changes

Slide 4

Slide 4 text

The SourceLair case • Each user gets a server per project • Every time is started to a new host:port • Exposed to a static public URL • Might be shut down

Slide 5

Slide 5 text

P1 P2 P3 P4 P5 P6 P1 P2 P3 P4 P5 P6 P1 P2 P3 P4 P5 P6 P1 P2 P3 P4 P5 P6 Proxy

Slide 6

Slide 6 text

Houston, we have a problem

Slide 7

Slide 7 text

Houston, we have a problem • We need a dynamic Proxy: Ceryx

Slide 8

Slide 8 text

Houston, we have a problem • We need a dynamic Proxy: • We need a way to inform user and “wake up” servers: Hemera

Slide 9

Slide 9 text

Houston, we have a problem • We need a dynamic Proxy: • We need a way to inform user and “wake up” servers: • We need a way to bootstrap servers from external services: SourceLair API

Slide 10

Slide 10 text

P1 P2 P3 P4 P5 P6 P1 P2 P3 P4 P5 P6 P1 P2 P3 P4 P5 P6 P1 P2 P3 P4 P5 P6 Ceryx Hemera SourceLair API

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Building Hemera • It took us less than two days • It needed 0-changes to our main application • Hooking it up with Ceryx was seamless

Slide 15

Slide 15 text

What about Ceryx

Slide 16

Slide 16 text

What about Ceryx • Ceryx had an API from day 1

Slide 17

Slide 17 text

What about Ceryx • Ceryx had an API from day 1 • That’s the only thing left from that day

Slide 18

Slide 18 text

Ceryx stages • Python Twisted with MongoDB and Redis as Cache • TProxy with Redis • NGINX and a watcher with etcd

Slide 19

Slide 19 text

Making NGINX dynamic • etcd for storing routes • Can watch for changes, without loss • NGINX for proxying • Using config file templates for configuration • The exact same API with previous versions

Slide 20

Slide 20 text

Thanks Antonis - SourceLair Talk to us :)