Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Power of Lacinia & Hsytrix in Production

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

The Power of Lacinia & Hsytrix in Production

Lacinia is Walmartlabs’ implementation of Facebook’s GraphQL on Clojure. It supports the full GraphQL spec, a high-performance parser for GraphQL queries built on Antlr4, and efficient and asynchronous query execution.

Hystrix is Netflix’ circuit-breaker implementation. It is a Java library that helps you control the interactions between distributed services by adding latency tolerance and fault tolerance logic.

By combining Lacinia’s resolvers and Hystrix’ highly performant thread-pool and fallback options you can achieve increased performance while also improving your system’s overall resiliency.

In this talk, we will explore the power of these two libraries together.

Avatar for Tiago Luchini

Tiago Luchini

October 13, 2017

Other Decks in Programming

Transcript

  1. Neutral Schema (Umlaut) Lacinia Schema SCHEMA CREATION GraphViz Diagram Clojure

    Spec JS GraphQL Schema Generator Generator Generator Generator
  2. POWER TO THE FRONT END… The Power of Lacinia &

    Hystrix in Production @tiagoluchini
  3. "The world hates change, yet it is the only thing

    that has brought progress." — Charles Kettering
  4. DO WE DEAL WITH IT? The Power of Lacinia &

    Hystrix in Production @tiagoluchini
  5. "The issues we are facing have all the same root

    cause. When the application makes a request to the backend, it in turn makes requests to 3rd party services which may take too long to complete or eventually fail. In such cases the app breaks with request timeout exception.
  6. Essentially what this means from a dev perspective is that…

    … the backend requires no fixes.” "The issues we are facing have all the same root cause. When the application makes a request to the backend, it in turn makes requests to 3rd party services which may take too long to complete or eventually fail. In such cases the app breaks with request timeout exception.
  7. 1 user → 1.5 pages/session + 40 requests/page → 60

    requests/session ~6% of our users experience ~500ms/session 493.3ms 99,9%
  8. µ = 100ms σ = 100ms µ = 100ms σ

    = 100ms TWO DEPENDENCIES LATENCY LATENCY
  9. µ = 100ms σ = 100ms µ = 2000ms σ

    = 2000ms TWO DEPENDENCIES LATENCY LATENCY
  10. Failure Fail Fast Fail Silently Static Stubbed Cached Content Fallback

    Common Fallback Strategies Chained Fallbacks Advanced
  11. Lacinia GraphQL Queries JSON Responses Resolvers GRAPHQL IS JUST PART

    OF THE EQUATION A) RESOLVERS MAY BE TOO COMPLEX
  12. Lacinia GraphQL Queries JSON Responses Resolvers GRAPHQL IS JUST PART

    OF THE EQUATION Hystrix A) RESOLVERS MAY BE TOO COMPLEX
  13. Lacinia GraphQL Queries JSON Responses Resolvers GRAPHQL IS JUST PART

    OF THE EQUATION Hystrix B) NO BROWSER CACHE! A) RESOLVERS MAY BE TOO COMPLEX
  14. Lacinia GraphQL Queries JSON Responses Resolvers GRAPHQL IS JUST PART

    OF THE EQUATION Hystrix Memcached B) NO BROWSER CACHE! A) RESOLVERS MAY BE TOO COMPLEX
  15. This Presentation & its code Lein Template Umlaut (Schema lang)

    wrk2 (Perf benchmarking) Do It Yourself Explore Recommended
  16. Hystrix Hystrix Stream Hystrix Dashboard Lacinia Lacinia Pedestal Links &

    References Hystrix & Lacinia Domo The Verge Text Request References
  17. Ashley O'Connor Fernando Andrade Igor Oliveira Justin Gehtland João Gomes

    Nikolas Moya Rafael Rinaldi Rodrigo Senra Rupal Parekh Acknowledgements Nikolas Moya (Umlaut) Howard L. Ship (Lacinia) Dave Ray (Hystrix Bindings) Gil Tene (Latency Benchmarking) Joseph Wilk (original Hystrix Streamer) This talk Open Source