Top Banner
39

A 9 line shop powered by armeria

Feb 17, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A 9 line shop powered by armeria
Page 2: A 9 line shop powered by armeria

1 Introductions LINE Shop & Armeria 2 Benefits of Armeria 3 How to use Armeria

Page 3: A 9 line shop powered by armeria

What is LINE Shop?

Page 4: A 9 line shop powered by armeria

What is Armeria?

・http://line.github.io/armeria/

・Asynchronous RPC/API client/server library built on top of

・Java 8, Netty 4.1, HTTP/2, and Thrift

Page 5: A 9 line shop powered by armeria

Name of Armeria

Page 6: A 9 line shop powered by armeria

Shop Architecture

Thr i f t Proxy

Talk-server

Shop-server Search FE Elast icsearch

Thr i f t web

Thr i f t

DB

Thr i f t REST

Page 7: A 9 line shop powered by armeria

Shop Architecture

Thr i f t Proxy

Talk-server

Shop-server Search FE Elast icsearch

Thr i f t REST

Thr i f t web

Thr i f t

Armeria Servers & Clients

DB

Page 8: A 9 line shop powered by armeria

Shop Architecture

Thr i f t Proxy

Talk-server

Shop-server Search FE Elast icsearch

Thr i f t REST

Thr i f t web

Thr i f t

Armeria Servers & Clients

DB Client in talk-server

Page 9: A 9 line shop powered by armeria
Page 10: A 9 line shop powered by armeria

Explore the Armeria World

Benefits of Armeria

・Production-Ready RPC layer ・Affinity with concurrent system ・Easy HTTP/2

Examples with code snippets

Page 11: A 9 line shop powered by armeria

Production-Ready RPC layer

Concurrent system Fits for the service processing

・many many ・ independent ・user requests ・with low latency!

i.e. most user-facing mobile services

・Like :)

Page 12: A 9 line shop powered by armeria

# of requests processed

Page 13: A 9 line shop powered by armeria

# of requests processed

Let's go deeper.

Page 14: A 9 line shop powered by armeria

# of backend requests

Page 15: A 9 line shop powered by armeria

# of backend requests

Page 16: A 9 line shop powered by armeria

# of backend requests

Page 17: A 9 line shop powered by armeria

# of backend requests

Page 18: A 9 line shop powered by armeria

Go Deeper

Many User Requests ・Which requires multiple backend requests ・ concurrently...

⇒ Many server-to-server requests and resource consumption!?

⇒ Yes and No!

Page 19: A 9 line shop powered by armeria

HTTP/2 !

Multiplexed requests & responses in 1 connection!

Page 20: A 9 line shop powered by armeria

Just one connection

Page 21: A 9 line shop powered by armeria

Reduced Listen Drops

Page 22: A 9 line shop powered by armeria

Benefits of Armeria

Armeria fits really well for our use case ・Concurrent system ・Connection management with HTTP/2 ・Easy to integrate with monitoring

Page 23: A 9 line shop powered by armeria

Some pitfalls too

Page 24: A 9 line shop powered by armeria

How to use Armeria

Code snippets

・Thrift ・HTTP

More Practices

・How we log the metrics and implement Zipkin integration.

Page 25: A 9 line shop powered by armeria

Server: Thrift

Page 26: A 9 line shop powered by armeria

Client: Thrift

Page 27: A 9 line shop powered by armeria

Server&Client: HTTP

Page 28: A 9 line shop powered by armeria

Metrics Logging & Zipkin Integration

Page 29: A 9 line shop powered by armeria

Real Code Examples

Page 30: A 9 line shop powered by armeria

Armeria from User point-of-view

Well-abstracted coding patterns

Useful “decorator” support ・Coming with metrics, logging, tracing, …

Page 31: A 9 line shop powered by armeria

And More Armeria!

Automated Document generator ・http://line.github.io/armeria/server-basics.html#adding-a-documentation-service

Circuit Breaker ・http://developers.linecorp.com/blog/ja/?p=3684

Client-side Load Balancing ・https://github.com/line/armeria/issues/87

Page 32: A 9 line shop powered by armeria

And More Armeria! (2)

gRPC support ・https://github.com/line/armeria/pull/247

Page 33: A 9 line shop powered by armeria

Code

Examples are available in

https://github.com/haruki-sugarsun/armeria_test

Page 34: A 9 line shop powered by armeria

Special Thanks

Armeria Authors ・Trustin Lee ・http://linedevday.linecorp.com/kr/2015/en/#t1s6 ・https://github.com/line/armeria/graphs/contributors

Teammates :)

Page 35: A 9 line shop powered by armeria

Teammates

Page 36: A 9 line shop powered by armeria

Summary

1 Armeria in Production

・Benefits of HTTP/2

2 Armeria use cases

& examples

Page 37: A 9 line shop powered by armeria

Q&A

Page 38: A 9 line shop powered by armeria
Page 39: A 9 line shop powered by armeria