SlideShare a Scribd company logo
1 of 64
Download to read offline
Java microservice development for high-speed services
Java Microservice lib
QBit
high-speed, in-memory,
services for REST, WebSocket
and JSON
Java microservice development for high-speed services
What is QBit?
❖ Fast queue based service engine!
❖ Services sit behind high-speed queues!
❖ Uses micro-batching and mechanical sympathy to create high speed REST
and WebSocket microservice!
❖ Programming model looks like Spring MVC, but enables high-speed async
model like Akka, Vertx, Reactor, but easier to program!
❖ Uses Consul or Etcd for clustering, health, cloud config, elasticity !
❖ Has event bus that can use Kafka, 0Q, etc.!
❖ Uses JSON for wire protocol, works easily with any language over HTTP or
WebSocket
Java microservice development for high-speed services
Why QBit?
❖ Just a lib, does not take over the world!
❖ Works with Guice or Spring!
❖ Just POJOs written like Java developers write POJOs no steep
learning curve!
❖ FAST!!
❖ Easier than reactive, worker pools, sharded services and queued
services!
❖ Uses Consul for service discovery, WebSocket for high-speed
messaging and REST
Java microservice development for high-speed services
Architects / Developers of QBit
❖ Wrote high throughput global services for large high-traffic clients!
❖ F5 crushing load!!
❖ Implemented systems that took other systems 10x to 100x as many servers and 20x
#of developers that could handle only 1/10th of the traffic !
❖ Wrote JSON parser that is 4x faster than mainstream JSON parsers!
❖ Been there, done that for 20+ years. 100+ years building high-speed, reliable systems
combined!
❖ Consulting with airlines, plane manufacturers, banks, commodity trading, electronic
manufacturing, and other trading systems!
❖ Wrote services that powers some of the busiest sites on the Internet!
❖ Wrote fastest disk batcher for JVM, high-speed, distributed k/v store, in-memory db
Java microservice development for high-speed services
QBit Speed - FAST!
❖ 200 M in-proc messages a second!
❖ 10M to 100M in-proc events per second!
❖ 700K to 1,000,000 RPC calls!
❖ Equates to 1.4M to 2M messages TPS!
❖ Using JSON! One Service Thread! One WebSocket!!
❖ Not uncommon to use a fraction of CPU for 2x to 10x to
100x the same performance as a traditional microservice
Java microservice development for high-speed services
It all starts with a fast queue
Java microservice development for high-speed services
Speed First
Java microservice development for high-speed services
Service Discovery / Health
❖ Integration with Consul for
health and event bus wiring
of peers!
❖ Cloud config!
❖ Peer discovery!
❖ Health Checks!
❖ Serf/Dead man’s switch,
gossip, custom
Java microservice development for high-speed services
Ease of use and simplicity too
Java microservice development for high-speed services
What is QBit again?
❖ Java microservice development for high-speed services!
❖ JSON!
❖ REST!
❖ WebSocket!
❖ Services look like Spring MVC REST / JAX-RS !
❖ look like Spring Boot, Drop-wizard but work like Spring reactor, Akka, Go,
ErLang, etc. !
❖ Embraces microservices!
❖ Clients can be Web, Mobile, any language that has JSON lib, HTTP lib can use
QBit services
Java microservice development for high-speed services
QBit Services
❖ WebSocket RPC, HTTP REST, and in-proc messaging!
❖ In-proc, sits behind an actor style queue, gets notified of
queue empty, queue limit, queue init, queue start batch,
etc.!
❖ Allows reduction of sending IO or calls to CPU
intensive services in batches based on queue events!
❖ Batching calls increases system throughput through
the system 10x, 100x, 1000x.
Java microservice development for high-speed services
Key Concepts
❖ `!
❖ Queue !
❖ A thread managing a queue. !
❖ supports batching. !
❖ queue callbacks for empty, reachedLimit,
startedBatch, idle, etc.!
❖ ServiceQueue!
❖ POJO (plain old Java object) behind a
queue!
❖ receive method calls and events !
❖ thread safe!
❖ queue callback methods!
❖ Java idioms looks like Spring MVC REST,
JAX-RS!
❖ ServiceBundle !
❖ Many POJOs behind one response queue
and many receive queues.
❖ ServiceServer !
❖ Exposes services to REST/JSON and
WebSocket/JSON communication!
❖ EventBus !
❖ send a lot of messages to services !
❖ may be loosely coupled,!
❖ integration with others event buses
(Kafka, STOMP, etc.)!
❖ Metrics/Stats: track in-flow, and outflow
of messages, other metrics for
performance, high-speed time-series
database with REST interface!
❖ Meta-Data-Service: Publish track all
REST JSON schemas for easy integration
and use by third parties
Java microservice development for high-speed services
Principles of QBit
❖ Web first (JSON, HTTP, WebSocket)!
❖ Integration via high-speed event bus (Kafka, STOMP,
0MQ, ActiveMQ, etc.)!
❖ Embrace Mechanical Sympathy and Queue Theory to
optimize thread hand-off, IO, and core cross talk!
❖ Less is more (be the 95% solution leave the long tail
alone)!
❖ Fun and easy to use!
Java microservice development for high-speed services
QBit Service Example
Domain Object
Service
WebSocket HTTP support
Java microservice development for high-speed services
QBit Example
CURL-ABLE
JSON Output
Java microservice development for high-speed services
Service REST support
❖ Supports Request params, URI params, JSON POST,
HTTP GET, etc.!
❖ Customize URIs using annotation!
❖ Reasonable Defaults (annotations not needed)!
❖ Methods available via annotations
Java microservice development for high-speed services
QBit versus….
Java microservice development for high-speed services
QBit versus Spring XXX
❖ Spring what? DI? MVC? Boot?!
❖ QBit Works easily with DI and Spring Boot!
❖ Competes against Spring MVC but has better thread
model for high-speed services, but not all the “features”.!
❖ Spring MVC does a lot. QBit only does Microservices
only! So only JSON, REST, and WebSocket!
❖ QBit Enable writing in-memory, high-speed services that
can handle 200K TPS to 2M TPS per second single node
Java microservice development for high-speed services
Akka vs. QBit
❖ Akka uses actor model!
❖ QBit uses queuing actor-like model + active objects model!
❖ Akka focuses on Queue handlers!
❖ QBit focuses on Services that look / act like Java services in
Spring REST, JAX-RS, Java EE, and other frameworks!
❖ QBit is a Java centric model, Akka programming model is similar
but foreign to most Java developers!
❖ QBit center of gravity is Microservices = REST, JSON, WebSocket
Java microservice development for high-speed services
Akka and QBit similarities/differences
❖ Akka Typed Actor a lot like QBit Service!
❖ QBit Services can be exposed via REST/JSON or
WebSocket/JSON!
❖ Both use queue events (empty, init, limit, etc.) to optimize
output to IO!
❖ Both are fast!
❖ QBit is library and you can use / compose queues,
services as you see fit (you could use QBit in a Spring app)
Java microservice development for high-speed services
Node.js, Vertx
❖ Node.js and Vertx both use a Reactor style design pattern based on event bus.
(QBit is reactive but using active objects not reactor.)!
❖ At first glance looks a lot like Akka or QBit!
❖ Less granularity on bus, QBit bus speed is a lot faster!
❖ Less control of when queue is idle, empty, etc. QBit has Akka like tuning which is
critical to optimize around back pressure.!
❖ Vertx/Node.js are harder to optimize. Harder to compose other handlers. !
❖ Great for IO and Vertx can be combined with QBit to provide missing pieces for
Speed!
❖ Not bad. Not even close to what QBit can do!
❖ QBit works well with Vertx
Java microservice development for high-speed services
How does it do?
❖ Faster!
❖ Easier to use!
❖ Focuses just on Micorservices!
❖ Tolerant reader, promiscuous writers!
❖ Uses RAFT and Consul for service discovery
Java microservice development for high-speed services
Event Bus Overview
Java microservice development for high-speed services
Event Bus
❖ QBit has a high-speed event bus modeled loosely on Vertx style
event bus!
❖ Very fast. !
❖ In-proc but can be integrated with others!
❖ Service methods can be invoked by calls (remote and local behind a
queue) !
❖ Service methods can be invoked by listening to a event bus
channels!
❖ You can subscribe to channels or you can consume channels or both
Java microservice development for high-speed services
Composable Event Bus
❖ EventBus can be composed!
❖ You can use the system event bus for in-proc service to service
messaging!
❖ You can remote replicate events to other servers!
❖ You can tap into an event bus, and/or post events to a service
directly for integration with 3rd party systems like Kafka, 0MQ,
etc.!
❖ You can use Consul integration to find service peers and
compose event bus that allows peers to communicate
Java microservice development for high-speed services
Event Bus is an Integration point
❖ Event bus is an integration point!
❖ Can be easily integrated with Camel, ActiveMQ, JMS,
Kafka, etc.!
❖ Events come in on same queue as method call!
❖ Event Bus can do remote broadcast and can discover
peers via Consul or Etcd
Java microservice development for high-speed services
QBit Event Bus
Java microservice development for high-speed services
Private event bus versus System event bus
❖ Private event bus!
❖ https://github.com/advantageous/qbit/wiki/%5BRough-Cut%5D-Working-
with-private-event-bus-for-inproc-microservices!
❖ Only your module uses it!
❖ System event bus!
❖ https://github.com/advantageous/qbit/wiki/%5BRough-Cut%5D-Working-
with-event-bus-for-QBit-the-microservice-engine!
❖ Used by default if you don’t define your own!
❖ Event buses are composable!
❖ events are intrinsic to Services and event buses can be wired to services and
other event buses
Java microservice development for high-speed services
Simple Example
Java 8 Lambda
Annotation Based
Send
Consumer
Subscriber
Java microservice development for high-speed services
More involved Example
❖ Advantage of using the event bus with QBit services is the events come into
same queue that handles method calls so events method calls are thread
safe!
❖ Event Bus is very fast. Expect speeds up to 10M to 100M messages a second.!
❖ New example: set of services that handles when a new employees is hired!
❖ Add the employee to payroll system, !
❖ Enroll employee into benefits system!
❖ Invite employee to our community outreach program!
❖ Four services but the first service will not know about other services
Java microservice development for high-speed services
Channels and Employee
Java microservice development for high-speed services
EmployeeHiringService
Java microservice development for high-speed services
Service that listen
Java microservice development for high-speed services
Java microservice development for high-speed services
Getting a client proxy to a service
Java microservice development for high-speed services
Services are just POJOs
Java microservice development for high-speed services
Wire in POJOs services
Java microservice development for high-speed services
Create a client proxy from service
Java microservice development for high-speed services
Add a new Service Listener?
Java microservice development for high-speed services
New Service
Java microservice development for high-speed services
Event Manager
❖ You can use a private event bus instead of a system
event bus!
❖ You can use strongly typed proxy to the event bus to
abstract channel names and provide a strongly typed
bus
Java microservice development for high-speed services
Strongly Type Interface
Java microservice development for high-speed services
Using strongly typed interface to event bus
Java microservice development for high-speed services
Using Strongly typed Event Proxy
Java microservice development for high-speed services
Using Strongly Typed Event Proxy-WIRING
Java microservice development for high-speed services
Working with callbacks
https://github.com/advantageous/qbit/wiki/%5BRough-Cut%5D-QBit-Microservice-Lib-
Working-With-CallBacks
Java microservice development for high-speed services
Callbacks
Java microservice development for high-speed services
Recommendation service callback
Java microservice development for high-speed services
ServiceQueue Proxy for service
Java microservice development for high-speed services
Recommendation service
Java microservice development for high-speed services
Handling a callback
Java microservice development for high-speed services
Java microservice development for high-speed services
Java microservice development for high-speed services
Lambdas are great until you can’t read your code anymore
Lambda calling Lambda, calling
Lambda calling Lambda.!
!
Stop using Lambda if your code
starts to look like Perl threw up on
Lisp.!
!
One, to three levels ok.!
!
Five or six, can you break this out
into a method call or two.
Java microservice development for high-speed services
Don’t forget to flush
Auto flushing is available
too!
Java microservice development for high-speed services
But gee what if we have to load the user data?
❖ The first rule is don’t block!
❖ Services can call other services!
❖ When a service might do IO then it should take a
callback instead of have a return (generally speaking)
Java microservice development for high-speed services
Java microservice development for high-speed services
Use Callback instead of blocking
Java microservice development for high-speed services
If user is loaded, just call callback
Java microservice development for high-speed services
If you need to load the user, do it async…
Java microservice development for high-speed services
Doing something later…, but not too much later
Java microservice development for high-speed services
Async procrastination a good thing…
Java microservice development for high-speed services
When to handle callbacks?
When your queue is
empty, !
when you hit your
queue limit,!
and !
perhaps at the start !
of a new message
batch?!
!
Handle callbacks
before handling new
method calls so
clients don’t wait
around with open
connections
Java microservice development for high-speed services
Workers for IO, Sharded Services for CPU
❖ QBit allows worker pools for IO bound workers!
❖ QBit allows sharded for CPU bound workers that work
on in-memory data!
❖ Or just regular workers!
❖ Queue system can detect when CPU bound services are
busy and auto-increase queue batch size

More Related Content

What's hot

Simple Solutions for Complex Problems
Simple Solutions for Complex Problems Simple Solutions for Complex Problems
Simple Solutions for Complex Problems Apcera
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Lohika_Odessa_TechTalks
 
Service discovery in mesos miguel, Angel Guillen
Service discovery in mesos miguel, Angel GuillenService discovery in mesos miguel, Angel Guillen
Service discovery in mesos miguel, Angel GuillenJ On The Beach
 
Devoxx Morocco 2016 - Microservices with Kafka
Devoxx Morocco 2016 - Microservices with KafkaDevoxx Morocco 2016 - Microservices with Kafka
Devoxx Morocco 2016 - Microservices with KafkaLászló-Róbert Albert
 
CQRS and ES with Lagom
CQRS and ES with LagomCQRS and ES with Lagom
CQRS and ES with LagomMiel Donkers
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesApcera
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaSteven Wu
 
Asynchronous Microservices in nodejs
Asynchronous Microservices in nodejsAsynchronous Microservices in nodejs
Asynchronous Microservices in nodejsBruno Pedro
 
Service discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring CloudService discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring CloudMarcelo Serpa
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio Mandar Jog
 
Reducing Microservice Complexity with Kafka and Reactive Streams
Reducing Microservice Complexity with Kafka and Reactive StreamsReducing Microservice Complexity with Kafka and Reactive Streams
Reducing Microservice Complexity with Kafka and Reactive Streamsjimriecken
 
Building Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache KafkaBuilding Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache KafkaBrian Ritchie
 
Building scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpidBuilding scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpidJack Gibson
 
Streaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in ProductionStreaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in Productionconfluent
 
Event Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuEvent Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuHeroku
 
Microservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got HereMicroservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got HereLightbend
 
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
The 6 Rules for Modernizing Your Legacy Java Monolith with MicroservicesThe 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
The 6 Rules for Modernizing Your Legacy Java Monolith with MicroservicesLightbend
 
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data PlatformStream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platformconfluent
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesEberhard Wolff
 

What's hot (20)

Consul
ConsulConsul
Consul
 
Simple Solutions for Complex Problems
Simple Solutions for Complex Problems Simple Solutions for Complex Problems
Simple Solutions for Complex Problems
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...Debugging Microservices - key challenges and techniques - Microservices Odesa...
Debugging Microservices - key challenges and techniques - Microservices Odesa...
 
Service discovery in mesos miguel, Angel Guillen
Service discovery in mesos miguel, Angel GuillenService discovery in mesos miguel, Angel Guillen
Service discovery in mesos miguel, Angel Guillen
 
Devoxx Morocco 2016 - Microservices with Kafka
Devoxx Morocco 2016 - Microservices with KafkaDevoxx Morocco 2016 - Microservices with Kafka
Devoxx Morocco 2016 - Microservices with Kafka
 
CQRS and ES with Lagom
CQRS and ES with LagomCQRS and ES with Lagom
CQRS and ES with Lagom
 
NATS for Modern Messaging and Microservices
NATS for Modern Messaging and MicroservicesNATS for Modern Messaging and Microservices
NATS for Modern Messaging and Microservices
 
Netflix Data Pipeline With Kafka
Netflix Data Pipeline With KafkaNetflix Data Pipeline With Kafka
Netflix Data Pipeline With Kafka
 
Asynchronous Microservices in nodejs
Asynchronous Microservices in nodejsAsynchronous Microservices in nodejs
Asynchronous Microservices in nodejs
 
Service discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring CloudService discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring Cloud
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio
 
Reducing Microservice Complexity with Kafka and Reactive Streams
Reducing Microservice Complexity with Kafka and Reactive StreamsReducing Microservice Complexity with Kafka and Reactive Streams
Reducing Microservice Complexity with Kafka and Reactive Streams
 
Building Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache KafkaBuilding Event-Driven Systems with Apache Kafka
Building Event-Driven Systems with Apache Kafka
 
Building scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpidBuilding scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpid
 
Streaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in ProductionStreaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in Production
 
Event Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuEvent Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on Heroku
 
Microservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got HereMicroservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got Here
 
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
The 6 Rules for Modernizing Your Legacy Java Monolith with MicroservicesThe 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
 
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data PlatformStream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
Stream Me Up, Scotty: Transitioning to the Cloud Using a Streaming Data Platform
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
 

Similar to The Java Microservice Library

Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architectureDevoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architectureBen Wilcock
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceRick Hightower
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services ArchitectureRanjan Baisak
 
Middleware in the cloud platform-v2
Middleware in the cloud   platform-v2Middleware in the cloud   platform-v2
Middleware in the cloud platform-v2Hammad Rajjoub
 
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...Spiffy
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOpsYongHyuk Lee
 
Microservices with Spring Cloud
Microservices with Spring CloudMicroservices with Spring Cloud
Microservices with Spring CloudDaniel Eichten
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用inwin stack
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting Vandana Verma
 
PHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolPHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolAlessandro Cinelli (cirpo)
 
Introduction to WSO2 Integration Platform
Introduction to WSO2 Integration PlatformIntroduction to WSO2 Integration Platform
Introduction to WSO2 Integration PlatformKasun Indrasiri
 
Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018Amazon Web Services
 
Integration in the age of DevOps
Integration in the age of DevOpsIntegration in the age of DevOps
Integration in the age of DevOpsAlbert Wong
 
Deploying Kafka on DC/OS
Deploying Kafka on DC/OSDeploying Kafka on DC/OS
Deploying Kafka on DC/OSKaufman Ng
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivRon Perlmuter
 
From PHP monolith to polyglot microservices
From PHP monolith to polyglot microservicesFrom PHP monolith to polyglot microservices
From PHP monolith to polyglot microservicesKazki Matsumoto
 

Similar to The Java Microservice Library (20)

Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architectureDevoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
 
WebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST MicroserviceWebSocket MicroService vs. REST Microservice
WebSocket MicroService vs. REST Microservice
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
Middleware in the cloud platform-v2
Middleware in the cloud   platform-v2Middleware in the cloud   platform-v2
Middleware in the cloud platform-v2
 
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
MS TechDays 2011 - How to Run Middleware in the Cloud Story of Windows Azure ...
 
Vert.X and MSA - DevOps
Vert.X and MSA - DevOpsVert.X and MSA - DevOps
Vert.X and MSA - DevOps
 
Microservices with Spring Cloud
Microservices with Spring CloudMicroservices with Spring Cloud
Microservices with Spring Cloud
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
利用K8S實現高可靠應用
利用K8S實現高可靠應用利用K8S實現高可靠應用
利用K8S實現高可靠應用
 
Web sockets - Pentesting
Web sockets - Pentesting Web sockets - Pentesting
Web sockets - Pentesting
 
PHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the foolPHP is the king, nodejs is the prince and Lua is the fool
PHP is the king, nodejs is the prince and Lua is the fool
 
Introduction to WSO2 Integration Platform
Introduction to WSO2 Integration PlatformIntroduction to WSO2 Integration Platform
Introduction to WSO2 Integration Platform
 
Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018Getting Started with Containers on AWS: Collision 2018
Getting Started with Containers on AWS: Collision 2018
 
Integration in the age of DevOps
Integration in the age of DevOpsIntegration in the age of DevOps
Integration in the age of DevOps
 
Deploying Kafka on DC/OS
Deploying Kafka on DC/OSDeploying Kafka on DC/OS
Deploying Kafka on DC/OS
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
Real time web apps
Real time web appsReal time web apps
Real time web apps
 
From PHP monolith to polyglot microservices
From PHP monolith to polyglot microservicesFrom PHP monolith to polyglot microservices
From PHP monolith to polyglot microservices
 
Servicestack
ServicestackServicestack
Servicestack
 

More from Rick Hightower

JParse Fast JSON Parser
JParse Fast JSON ParserJParse Fast JSON Parser
JParse Fast JSON ParserRick Hightower
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumRick Hightower
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Rick Hightower
 
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and MicroservicesRick Hightower
 
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesRick Hightower
 
Accelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesAccelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesRick Hightower
 
Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.Rick Hightower
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)Rick Hightower
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)Rick Hightower
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsRick Hightower
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive MicroservicesRick Hightower
 
Netty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsNetty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsRick Hightower
 
Netty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and BuffersNetty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and BuffersRick Hightower
 
MongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developersMongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developersRick Hightower
 
Mongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersMongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersRick Hightower
 

More from Rick Hightower (17)

JParse Fast JSON Parser
JParse Fast JSON ParserJParse Fast JSON Parser
JParse Fast JSON Parser
 
Service Mesh Talk for CTO Forum
Service Mesh Talk for CTO ForumService Mesh Talk for CTO Forum
Service Mesh Talk for CTO Forum
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business Case for Agile DevOps, CI/CD and Microservices
 
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and MicroservicesAccelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
Accelerate Delivery: Business case for Agile DevOps, CI/CD and Microservices
 
Accelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and KubernetesAccelerate DevOps/Microservices and Kubernetes
Accelerate DevOps/Microservices and Kubernetes
 
Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.Accelerate using DevOps and CI/CD.
Accelerate using DevOps and CI/CD.
 
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)Reactive Java:  Promises and Streams with Reakt (JavaOne Talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne Talk 2016)
 
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)Reactive Java: Promises and Streams with Reakt  (JavaOne talk 2016)
Reactive Java: Promises and Streams with Reakt (JavaOne talk 2016)
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulations
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive Microservices
 
Netty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoopsNetty Notes Part 3 - Channel Pipeline and EventLoops
Netty Notes Part 3 - Channel Pipeline and EventLoops
 
Netty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and BuffersNetty Notes Part 2 - Transports and Buffers
Netty Notes Part 2 - Transports and Buffers
 
Notes on Netty baics
Notes on Netty baicsNotes on Netty baics
Notes on Netty baics
 
Java JSON Benchmark
Java JSON BenchmarkJava JSON Benchmark
Java JSON Benchmark
 
MongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developersMongoDB quickstart for Java, PHP, and Python developers
MongoDB quickstart for Java, PHP, and Python developers
 
Mongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP DevelopersMongo DB for Java, Python and PHP Developers
Mongo DB for Java, Python and PHP Developers
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Recently uploaded (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

The Java Microservice Library

  • 1. Java microservice development for high-speed services Java Microservice lib QBit high-speed, in-memory, services for REST, WebSocket and JSON
  • 2. Java microservice development for high-speed services What is QBit? ❖ Fast queue based service engine! ❖ Services sit behind high-speed queues! ❖ Uses micro-batching and mechanical sympathy to create high speed REST and WebSocket microservice! ❖ Programming model looks like Spring MVC, but enables high-speed async model like Akka, Vertx, Reactor, but easier to program! ❖ Uses Consul or Etcd for clustering, health, cloud config, elasticity ! ❖ Has event bus that can use Kafka, 0Q, etc.! ❖ Uses JSON for wire protocol, works easily with any language over HTTP or WebSocket
  • 3. Java microservice development for high-speed services Why QBit? ❖ Just a lib, does not take over the world! ❖ Works with Guice or Spring! ❖ Just POJOs written like Java developers write POJOs no steep learning curve! ❖ FAST!! ❖ Easier than reactive, worker pools, sharded services and queued services! ❖ Uses Consul for service discovery, WebSocket for high-speed messaging and REST
  • 4. Java microservice development for high-speed services Architects / Developers of QBit ❖ Wrote high throughput global services for large high-traffic clients! ❖ F5 crushing load!! ❖ Implemented systems that took other systems 10x to 100x as many servers and 20x #of developers that could handle only 1/10th of the traffic ! ❖ Wrote JSON parser that is 4x faster than mainstream JSON parsers! ❖ Been there, done that for 20+ years. 100+ years building high-speed, reliable systems combined! ❖ Consulting with airlines, plane manufacturers, banks, commodity trading, electronic manufacturing, and other trading systems! ❖ Wrote services that powers some of the busiest sites on the Internet! ❖ Wrote fastest disk batcher for JVM, high-speed, distributed k/v store, in-memory db
  • 5. Java microservice development for high-speed services QBit Speed - FAST! ❖ 200 M in-proc messages a second! ❖ 10M to 100M in-proc events per second! ❖ 700K to 1,000,000 RPC calls! ❖ Equates to 1.4M to 2M messages TPS! ❖ Using JSON! One Service Thread! One WebSocket!! ❖ Not uncommon to use a fraction of CPU for 2x to 10x to 100x the same performance as a traditional microservice
  • 6. Java microservice development for high-speed services It all starts with a fast queue
  • 7. Java microservice development for high-speed services Speed First
  • 8. Java microservice development for high-speed services Service Discovery / Health ❖ Integration with Consul for health and event bus wiring of peers! ❖ Cloud config! ❖ Peer discovery! ❖ Health Checks! ❖ Serf/Dead man’s switch, gossip, custom
  • 9. Java microservice development for high-speed services Ease of use and simplicity too
  • 10. Java microservice development for high-speed services What is QBit again? ❖ Java microservice development for high-speed services! ❖ JSON! ❖ REST! ❖ WebSocket! ❖ Services look like Spring MVC REST / JAX-RS ! ❖ look like Spring Boot, Drop-wizard but work like Spring reactor, Akka, Go, ErLang, etc. ! ❖ Embraces microservices! ❖ Clients can be Web, Mobile, any language that has JSON lib, HTTP lib can use QBit services
  • 11. Java microservice development for high-speed services QBit Services ❖ WebSocket RPC, HTTP REST, and in-proc messaging! ❖ In-proc, sits behind an actor style queue, gets notified of queue empty, queue limit, queue init, queue start batch, etc.! ❖ Allows reduction of sending IO or calls to CPU intensive services in batches based on queue events! ❖ Batching calls increases system throughput through the system 10x, 100x, 1000x.
  • 12. Java microservice development for high-speed services Key Concepts ❖ `! ❖ Queue ! ❖ A thread managing a queue. ! ❖ supports batching. ! ❖ queue callbacks for empty, reachedLimit, startedBatch, idle, etc.! ❖ ServiceQueue! ❖ POJO (plain old Java object) behind a queue! ❖ receive method calls and events ! ❖ thread safe! ❖ queue callback methods! ❖ Java idioms looks like Spring MVC REST, JAX-RS! ❖ ServiceBundle ! ❖ Many POJOs behind one response queue and many receive queues. ❖ ServiceServer ! ❖ Exposes services to REST/JSON and WebSocket/JSON communication! ❖ EventBus ! ❖ send a lot of messages to services ! ❖ may be loosely coupled,! ❖ integration with others event buses (Kafka, STOMP, etc.)! ❖ Metrics/Stats: track in-flow, and outflow of messages, other metrics for performance, high-speed time-series database with REST interface! ❖ Meta-Data-Service: Publish track all REST JSON schemas for easy integration and use by third parties
  • 13. Java microservice development for high-speed services Principles of QBit ❖ Web first (JSON, HTTP, WebSocket)! ❖ Integration via high-speed event bus (Kafka, STOMP, 0MQ, ActiveMQ, etc.)! ❖ Embrace Mechanical Sympathy and Queue Theory to optimize thread hand-off, IO, and core cross talk! ❖ Less is more (be the 95% solution leave the long tail alone)! ❖ Fun and easy to use!
  • 14. Java microservice development for high-speed services QBit Service Example Domain Object Service WebSocket HTTP support
  • 15. Java microservice development for high-speed services QBit Example CURL-ABLE JSON Output
  • 16. Java microservice development for high-speed services Service REST support ❖ Supports Request params, URI params, JSON POST, HTTP GET, etc.! ❖ Customize URIs using annotation! ❖ Reasonable Defaults (annotations not needed)! ❖ Methods available via annotations
  • 17. Java microservice development for high-speed services QBit versus….
  • 18. Java microservice development for high-speed services QBit versus Spring XXX ❖ Spring what? DI? MVC? Boot?! ❖ QBit Works easily with DI and Spring Boot! ❖ Competes against Spring MVC but has better thread model for high-speed services, but not all the “features”.! ❖ Spring MVC does a lot. QBit only does Microservices only! So only JSON, REST, and WebSocket! ❖ QBit Enable writing in-memory, high-speed services that can handle 200K TPS to 2M TPS per second single node
  • 19. Java microservice development for high-speed services Akka vs. QBit ❖ Akka uses actor model! ❖ QBit uses queuing actor-like model + active objects model! ❖ Akka focuses on Queue handlers! ❖ QBit focuses on Services that look / act like Java services in Spring REST, JAX-RS, Java EE, and other frameworks! ❖ QBit is a Java centric model, Akka programming model is similar but foreign to most Java developers! ❖ QBit center of gravity is Microservices = REST, JSON, WebSocket
  • 20. Java microservice development for high-speed services Akka and QBit similarities/differences ❖ Akka Typed Actor a lot like QBit Service! ❖ QBit Services can be exposed via REST/JSON or WebSocket/JSON! ❖ Both use queue events (empty, init, limit, etc.) to optimize output to IO! ❖ Both are fast! ❖ QBit is library and you can use / compose queues, services as you see fit (you could use QBit in a Spring app)
  • 21. Java microservice development for high-speed services Node.js, Vertx ❖ Node.js and Vertx both use a Reactor style design pattern based on event bus. (QBit is reactive but using active objects not reactor.)! ❖ At first glance looks a lot like Akka or QBit! ❖ Less granularity on bus, QBit bus speed is a lot faster! ❖ Less control of when queue is idle, empty, etc. QBit has Akka like tuning which is critical to optimize around back pressure.! ❖ Vertx/Node.js are harder to optimize. Harder to compose other handlers. ! ❖ Great for IO and Vertx can be combined with QBit to provide missing pieces for Speed! ❖ Not bad. Not even close to what QBit can do! ❖ QBit works well with Vertx
  • 22. Java microservice development for high-speed services How does it do? ❖ Faster! ❖ Easier to use! ❖ Focuses just on Micorservices! ❖ Tolerant reader, promiscuous writers! ❖ Uses RAFT and Consul for service discovery
  • 23. Java microservice development for high-speed services Event Bus Overview
  • 24. Java microservice development for high-speed services Event Bus ❖ QBit has a high-speed event bus modeled loosely on Vertx style event bus! ❖ Very fast. ! ❖ In-proc but can be integrated with others! ❖ Service methods can be invoked by calls (remote and local behind a queue) ! ❖ Service methods can be invoked by listening to a event bus channels! ❖ You can subscribe to channels or you can consume channels or both
  • 25. Java microservice development for high-speed services Composable Event Bus ❖ EventBus can be composed! ❖ You can use the system event bus for in-proc service to service messaging! ❖ You can remote replicate events to other servers! ❖ You can tap into an event bus, and/or post events to a service directly for integration with 3rd party systems like Kafka, 0MQ, etc.! ❖ You can use Consul integration to find service peers and compose event bus that allows peers to communicate
  • 26. Java microservice development for high-speed services Event Bus is an Integration point ❖ Event bus is an integration point! ❖ Can be easily integrated with Camel, ActiveMQ, JMS, Kafka, etc.! ❖ Events come in on same queue as method call! ❖ Event Bus can do remote broadcast and can discover peers via Consul or Etcd
  • 27. Java microservice development for high-speed services QBit Event Bus
  • 28. Java microservice development for high-speed services Private event bus versus System event bus ❖ Private event bus! ❖ https://github.com/advantageous/qbit/wiki/%5BRough-Cut%5D-Working- with-private-event-bus-for-inproc-microservices! ❖ Only your module uses it! ❖ System event bus! ❖ https://github.com/advantageous/qbit/wiki/%5BRough-Cut%5D-Working- with-event-bus-for-QBit-the-microservice-engine! ❖ Used by default if you don’t define your own! ❖ Event buses are composable! ❖ events are intrinsic to Services and event buses can be wired to services and other event buses
  • 29. Java microservice development for high-speed services Simple Example Java 8 Lambda Annotation Based Send Consumer Subscriber
  • 30. Java microservice development for high-speed services More involved Example ❖ Advantage of using the event bus with QBit services is the events come into same queue that handles method calls so events method calls are thread safe! ❖ Event Bus is very fast. Expect speeds up to 10M to 100M messages a second.! ❖ New example: set of services that handles when a new employees is hired! ❖ Add the employee to payroll system, ! ❖ Enroll employee into benefits system! ❖ Invite employee to our community outreach program! ❖ Four services but the first service will not know about other services
  • 31. Java microservice development for high-speed services Channels and Employee
  • 32. Java microservice development for high-speed services EmployeeHiringService
  • 33. Java microservice development for high-speed services Service that listen
  • 34. Java microservice development for high-speed services
  • 35. Java microservice development for high-speed services Getting a client proxy to a service
  • 36. Java microservice development for high-speed services Services are just POJOs
  • 37. Java microservice development for high-speed services Wire in POJOs services
  • 38. Java microservice development for high-speed services Create a client proxy from service
  • 39. Java microservice development for high-speed services Add a new Service Listener?
  • 40. Java microservice development for high-speed services New Service
  • 41. Java microservice development for high-speed services Event Manager ❖ You can use a private event bus instead of a system event bus! ❖ You can use strongly typed proxy to the event bus to abstract channel names and provide a strongly typed bus
  • 42. Java microservice development for high-speed services Strongly Type Interface
  • 43. Java microservice development for high-speed services Using strongly typed interface to event bus
  • 44. Java microservice development for high-speed services Using Strongly typed Event Proxy
  • 45. Java microservice development for high-speed services Using Strongly Typed Event Proxy-WIRING
  • 46. Java microservice development for high-speed services Working with callbacks https://github.com/advantageous/qbit/wiki/%5BRough-Cut%5D-QBit-Microservice-Lib- Working-With-CallBacks
  • 47. Java microservice development for high-speed services Callbacks
  • 48. Java microservice development for high-speed services Recommendation service callback
  • 49. Java microservice development for high-speed services ServiceQueue Proxy for service
  • 50. Java microservice development for high-speed services Recommendation service
  • 51. Java microservice development for high-speed services Handling a callback
  • 52. Java microservice development for high-speed services
  • 53. Java microservice development for high-speed services
  • 54. Java microservice development for high-speed services Lambdas are great until you can’t read your code anymore Lambda calling Lambda, calling Lambda calling Lambda.! ! Stop using Lambda if your code starts to look like Perl threw up on Lisp.! ! One, to three levels ok.! ! Five or six, can you break this out into a method call or two.
  • 55. Java microservice development for high-speed services Don’t forget to flush Auto flushing is available too!
  • 56. Java microservice development for high-speed services But gee what if we have to load the user data? ❖ The first rule is don’t block! ❖ Services can call other services! ❖ When a service might do IO then it should take a callback instead of have a return (generally speaking)
  • 57. Java microservice development for high-speed services
  • 58. Java microservice development for high-speed services Use Callback instead of blocking
  • 59. Java microservice development for high-speed services If user is loaded, just call callback
  • 60. Java microservice development for high-speed services If you need to load the user, do it async…
  • 61. Java microservice development for high-speed services Doing something later…, but not too much later
  • 62. Java microservice development for high-speed services Async procrastination a good thing…
  • 63. Java microservice development for high-speed services When to handle callbacks? When your queue is empty, ! when you hit your queue limit,! and ! perhaps at the start ! of a new message batch?! ! Handle callbacks before handling new method calls so clients don’t wait around with open connections
  • 64. Java microservice development for high-speed services Workers for IO, Sharded Services for CPU ❖ QBit allows worker pools for IO bound workers! ❖ QBit allows sharded for CPU bound workers that work on in-memory data! ❖ Or just regular workers! ❖ Queue system can detect when CPU bound services are busy and auto-increase queue batch size