Using APIs for Microservices at SourceLair

Using APIs for Microservices at SourceLair

In SourceLair, having an internal API helped us a lot in building microservices quick and effectively. Having an internal API helps a lot in code quality by building microservices and is an actual need, even if exposing all or part of it is not a future goal.

Ae7266b2a8b6a0fc8df19a3d732d6223?s=128

Antonis Kalipetis

February 16, 2015
Tweet

Transcript

  1. Using APIs for Microservices Antonis Kalipetis - @akalipetis www.SourceLair.com API

    Meetup 16/02/2015
  2. –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.”
  3. Importance of APIs • Language agnostic • Clearly define a

    way of communication • Do not “care” about internal changes
  4. 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
  5. 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
  6. Houston, we have a problem

  7. Houston, we have a problem • We need a dynamic

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

    Proxy: • We need a way to inform user and “wake up” servers: Hemera
  9. 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
  10. 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
  11. None
  12. None
  13. None
  14. Building Hemera • It took us less than two days

    • It needed 0-changes to our main application • Hooking it up with Ceryx was seamless
  15. What about Ceryx

  16. What about Ceryx • Ceryx had an API from day

    1
  17. What about Ceryx • Ceryx had an API from day

    1 • That’s the only thing left from that day
  18. Ceryx stages • Python Twisted with MongoDB and Redis as

    Cache • TProxy with Redis • NGINX and a watcher with etcd
  19. 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
  20. Thanks Antonis - SourceLair Talk to us :)