Microservices with NetflixOSS: Karyon, Ribbon and Eureka part 1

On the previous post i was talking about the NetflixOSS Stack(http://diego-pacheco.blogspot.com/2015/09/netflixoss-devops-stack-for.html) on this post i will cover with more details some of the middleware core components - the focus of this post will be Karyon, Ribbon and Eureka.

There are 3 main key principles behind this components. First of all is Reference Transparency, with Eureka you an register a service and you also can do queries on eureka before you do request calls through Ribbon - So eureka is key Discoverability Solution for Netflix. When you have microservices you will have lots of services and you will need to have redundancy and is impossible to handle all that with manual IP - specialty if you do Immutable Infrastructure and cloud native so you will create a destroy lots of instances - machines will fail all the time and ips change all the time.


The second great principle is anti-fragility - with Ribbon you can do retrys, timeouts and and make sure you have fall backs in order to degrade user experience but dont fail like the anti-patterns we saw in J2EE when a failure cascade other failures - instead you want isolate the failure.

Last but not least we have performance - Ribbon can do IPC and uses RxNetty and RxJava so we can do calls with non-blocking IO and also do functional reactive programming using functions. Its not just roses - there are drawbacks like errors handling is harder and java 8 still not quite functional as scala and clojure. But you dont need code in java - since is all JVM you can do in Scala or even Clojure.

NetflixOSS Karyon 

Karyon is the nucleus of the middleware cloud stack platform. Karyon is a molecular biology term that means part of cell that have RNA and DNA responsible to grow and reproduction. Karyon contains the blueprint for cloud service development using Netflix microservices.

Karyon does all bootstrap and wiring using GUICE and Governator. Also it gives runtime insights of the JVM with a built in admin console is kinda of component driven architecture. Karyon is plugable and it works with JAX-RS-311 spec so you can use Jersey. It`s totally cloud ready - it have integration with Eureka(Netflix Service Discoverability Solution). Trought web-admin you can see Servo metrics and archaius configurations.

Archaius - Admin Console 

JMX Beans on Admin console

Karyon can work with more than one webserver because its just an adpater in the end of the day - today netlix uses RxNetty and it proof be faster and very resource efficient.

NetflixOss Ribbon

Ribbon do lots of very interesting tasks. With ribbon you can do SAFE native clients for SOA but if you are not 100% sure about IPC you still can do Ribbon with REST. Ribbon offers client side load balancing and discovery thought Eureka. Ribbon is used todo internal load balancing for internal services - for external services(They also call they Edge services) Netflix use AWS Elastic Load Balancers.

Ribbon can do simple round robin but also more complicated tasks like multi-zone load balancing and this is really great because it works on towards the direction of anti-fragility.


Ribbon AZ Aware Load Balancer

NetflixOss Eureka

Eureka is the Service Discoverability Solution that Netflix uses. It have a server(WAR file) and has clients. Eureka can work inside and outside AWS but was built with AWS in mind. Eureka also can carry adicional service metada information.

Eureka Architecture

With this compoents together and with the help of Governator, Servo, Archaius, RxJava, RxNetty Server you can start builing microservices that are cloud native. Eureka has a very nice REST api so you can query all services taht are avaliable and metadata this is great because you can levarage that for non-java clients as well.

Cheers,
Diego Pacheco

Popular posts from this blog

Telemetry and Microservices part2

Installing and Running ntop 2 on Amazon Linux OS

Fun with Apache Kafka