SlideShare a Scribd company logo
이희승 (@trustin) / 開発1センター / LINE
Building Asynchronous
Microservices with Armeria
Armeriaで始める非同期Microservice開発
Why build another
microservice framework?
Asynchrony
●
Most web frameworks are blocking and synchronous.
– 1000 concurrent requests require 1000 threads.
– In modern systems, a service sends requests to another backend.
– Threads are busy doing nothing but just waiting for the backend.
– Request queue is not consumed fast enough.
– Result:
●
Fragile system that falls apart even on a tiny backend failure
●
Inefficient system that takes more memory and CPU than what it actually does
Reactive Streams
●
Should we really buffer everything until a response is sent?
– Retrieving 100,000 rows from a table
●
Why should a client send many requests to reduce the server memory
pressure?
– Retrieving 1,000 rows 100 times
●
What if we want to stream infinitely?
– Stock quotes
●
Our protocol is not a problem here.
– Our ‘blocking’ programming model is blocking ‘us’.
Better RPC support
●
RPC has been hardly a 1st-class citizen in web
frameworks.
– Distinction from RPC-level and HTTP-level failure
– Access logs with RPC-level details
– Debugging console
●
What if …
– We build a microservice framework with RPC at its core?
More reasons back in 2015
●
Leverage Java 8 syntax
– Lambda expressions
– Default interface methods
– Static interface methods
●
Provide ‘working’ HTTP/2 implementation
– ‘H2C’ support (HTTP/2 over ‘C’leartext)
– OpenSSL-based faster TLS connection
Better UX for devs
●
This is the last yet most important part.
●
Nobody wants a framework that’s hard to use.
●
Can we design …
– a user-friendly asynchronous programming API
– … with modest learning curve?
Our answer – Armeria
●
HTTP/2
– Both ciphertext and cleartext, a.k.a. h2 and h2c
●
Reactive
– Implements Reactive Streams API
●
Ability to mix different types of services in a single server
– gRPC, Thrift, REST services
– Legacy webapps via embedded Tomcat or Jetty
●
High-performance
– Netty with /dev/epoll transport and BoringSSL SSLEngine
●
Easy to learn and fun to use (hopefully)
Armeria by examples
HTTP / REST
Hello, world!
Hello, world – Parameterized
Hello, world – Annotated
With CompletableFuture
Streaming a million integers
Building Asynchronous Microservices with Armeria
There are more!
●
Query parameters
●
Request and response converters
●
Exception handlers
●
Content type negotiation
●
Regular-expression path mapping
●
Aims to be on-par or better than <your favorite web framework>
Armeria by examples
Thrift and gRPC
gRPC & Thrift basics
a. Write an IDL file – .proto or .thrift
b. A compiler compiles it into .java files.
c. Implement interfaces generated at ‘b’.
gRPC
Thrift
Decorating services
Separation of concerns
Intercepting an HTTP request
Intercepting a RPC request
●
Complete access to the RPC call information
●
Override the parameters and methods
Decorator as core extension mechanism
●
Request throttling
●
Metric collection
●
Distributed tracing (Zipkin)
●
HTTP content encoding
●
HTTP authn/z
●
CORS
●
Circuit breakers
●
Automatic retries
●
…
Distributed tracing with Brave·Zipkin
Playing better with RPC
Armeria documentation service
Armeria documentation service
●
Enabled by adding DocService to ServerBuilder
●
Browse and invoke RPC services in an Armeria server
●
Supports both gRPC and Thrift
●
We have a plan to add:
– Support for plain HTTP, like Swagger
– Metric monitoring console
– Runtime configuration editor, e.g. logger level
Building Asynchronous Microservices with Armeria
Building Asynchronous Microservices with Armeria
●
Share the URL to reproduce a call.
All the pieces fit together
The ultimate all-in-one micro(?) service
Building Asynchronous Microservices with Armeria
What about client-side?
Armeria client API
●
Similar experience to the server-side API
– e.g. Common type, Decorators, RPC-friendliness
●
Client-specific stuff
– Circuit breakers
– Automatic retries
– Client-side load balancing
– Retrofit integration
Building Asynchronous Microservices with Armeria
Got interested?
Let’s build Armeria together!
●
Use it.
●
Ask questions.
●
Request new features.
●
Tell us what rocks and sucks.
●
Consider joining the effort.
Meet us at GitHub and Slack
●
https://github.com/line/armeria
●
https://line-slacknow.herokuapp.com/line-armeria/

More Related Content

What's hot (19)

PDF
Varnish to the rescue
leafnode
 
ODP
Memcache d
Abhishek Tomar
 
PDF
From One to a Cluster
guestd34230
 
PPTX
Peer Cache for Configuration Manager clients
Karthick Jokirathinam
 
PDF
Web Performance Part 3 "Server-side tips"
Binary Studio
 
PDF
Rubyhosting
Artit Rubybox
 
PDF
Thin client SPAs. Stream UI using web standards
Starcounter
 
PDF
Thin client SPAs? Stream UI using web standards (CodeNight)
Starcounter
 
PDF
Apache BookKeeper: A High Performance and Low Latency Storage Service
Sijie Guo
 
PDF
EVCache & Moneta (GoSF)
Scott Mansfield
 
PPTX
Data integration with rabbit mq and celery
edytarcio
 
PDF
Application Caching: The Hidden Microservice (SAConf)
Scott Mansfield
 
PPTX
Windows Azure Service Bus
Pavel Revenkov
 
PDF
RabbitMQ & Hutch
Peter Hamilton
 
PDF
Cloud Messaging Service: Technical Overview
Messaging Meetup
 
PDF
ASP.NET Scalability - WebDD
Phil Pursglove
 
PDF
ASP.NET Scalability - VBUG London
Phil Pursglove
 
PDF
Headless approach for offloading heavy tasks in Magento
Sander Mangel
 
PDF
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
camp_drupal_ua
 
Varnish to the rescue
leafnode
 
Memcache d
Abhishek Tomar
 
From One to a Cluster
guestd34230
 
Peer Cache for Configuration Manager clients
Karthick Jokirathinam
 
Web Performance Part 3 "Server-side tips"
Binary Studio
 
Rubyhosting
Artit Rubybox
 
Thin client SPAs. Stream UI using web standards
Starcounter
 
Thin client SPAs? Stream UI using web standards (CodeNight)
Starcounter
 
Apache BookKeeper: A High Performance and Low Latency Storage Service
Sijie Guo
 
EVCache & Moneta (GoSF)
Scott Mansfield
 
Data integration with rabbit mq and celery
edytarcio
 
Application Caching: The Hidden Microservice (SAConf)
Scott Mansfield
 
Windows Azure Service Bus
Pavel Revenkov
 
RabbitMQ & Hutch
Peter Hamilton
 
Cloud Messaging Service: Technical Overview
Messaging Meetup
 
ASP.NET Scalability - WebDD
Phil Pursglove
 
ASP.NET Scalability - VBUG London
Phil Pursglove
 
Headless approach for offloading heavy tasks in Magento
Sander Mangel
 
Pankov Artem.Improving drupal performance www.hr portal.ru.DrupalCamp Kyiv 2011
camp_drupal_ua
 

Similar to Building Asynchronous Microservices with Armeria (20)

PDF
LINE Bot API with Armeria
Soo Kim
 
PPTX
Quick intro to armeria
LINE Corporation
 
PDF
Quick intro to armeria
LINE Corporation
 
PPTX
Architecture Sustaining LINE Sticker services
LINE Corporation
 
PDF
A 9 line shop powered by armeria
LINE Corporation
 
PPTX
Where is my scalable API?
Juan Pablo Genovese
 
PPTX
Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2
Atharva Jawalkar
 
PPTX
Where is my scalable api?
Altoros
 
PPTX
Apache Thrift, a brief introduction
Randy Abernethy
 
PDF
A microservice architecture based on golang
Gianfranco Reppucci
 
PDF
Dragoncraft Architectural Overview
jessesanford
 
PDF
SOA Latam 2015
Domingo Suarez Torres
 
PDF
Microservices Architecture For Conversational Intelligence Platform
Rafael Casuso Romate
 
PPTX
Tef con2016 (1)
ggarber
 
PPTX
Yotpo microservices
Ron Barabash
 
PDF
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
PPTX
Digging deeper into service stack
cyberzeddk
 
PPTX
Build a Node.js Client for Your REST+JSON API
Stormpath
 
PPTX
Service stack all the things
cyberzeddk
 
PDF
A Guide for Communication with Distributed Web Applications in Mobile Networks
Agastheswar Suribhatla
 
LINE Bot API with Armeria
Soo Kim
 
Quick intro to armeria
LINE Corporation
 
Quick intro to armeria
LINE Corporation
 
Architecture Sustaining LINE Sticker services
LINE Corporation
 
A 9 line shop powered by armeria
LINE Corporation
 
Where is my scalable API?
Juan Pablo Genovese
 
Monolithic and Microservice architecture, Feature of Node JS 10, HTTP2
Atharva Jawalkar
 
Where is my scalable api?
Altoros
 
Apache Thrift, a brief introduction
Randy Abernethy
 
A microservice architecture based on golang
Gianfranco Reppucci
 
Dragoncraft Architectural Overview
jessesanford
 
SOA Latam 2015
Domingo Suarez Torres
 
Microservices Architecture For Conversational Intelligence Platform
Rafael Casuso Romate
 
Tef con2016 (1)
ggarber
 
Yotpo microservices
Ron Barabash
 
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
Digging deeper into service stack
cyberzeddk
 
Build a Node.js Client for Your REST+JSON API
Stormpath
 
Service stack all the things
cyberzeddk
 
A Guide for Communication with Distributed Web Applications in Mobile Networks
Agastheswar Suribhatla
 
Ad

More from LINE Corporation (20)

PDF
JJUG CCC 2018 Fall 懇親会LT
LINE Corporation
 
PDF
Reduce dependency on Rx with Kotlin Coroutines
LINE Corporation
 
PDF
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
LINE Corporation
 
PDF
Use Kotlin scripts and Clova SDK to build your Clova extension
LINE Corporation
 
PDF
The Magic of LINE 購物 Testing
LINE Corporation
 
PPTX
GA Test Automation
LINE Corporation
 
PDF
UI Automation Test with JUnit5
LINE Corporation
 
PDF
Feature Detection for UI Testing
LINE Corporation
 
PDF
LINE 新星計劃介紹與新創團隊分享
LINE Corporation
 
PDF
​LINE 技術合作夥伴與應用分享
LINE Corporation
 
PDF
LINE 開發者社群經營與技術推廣
LINE Corporation
 
PDF
日本開發者大會短講分享
LINE Corporation
 
PDF
LINE Chatbot - 活動報名報到設計分享
LINE Corporation
 
PDF
在 LINE 私有雲中使用 Managed Kubernetes
LINE Corporation
 
PDF
LINE TODAY高效率的敏捷測試開發技巧
LINE Corporation
 
PDF
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE Corporation
 
PDF
LINE Things - LINE IoT平台新技術分享
LINE Corporation
 
PDF
LINE Pay - 一卡通支付新體驗
LINE Corporation
 
PDF
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Corporation
 
PDF
Keynote - ​LINE 的技術策略佈局與跨國產品開發
LINE Corporation
 
JJUG CCC 2018 Fall 懇親会LT
LINE Corporation
 
Reduce dependency on Rx with Kotlin Coroutines
LINE Corporation
 
Kotlin/NativeでAndroidのNativeメソッドを実装してみた
LINE Corporation
 
Use Kotlin scripts and Clova SDK to build your Clova extension
LINE Corporation
 
The Magic of LINE 購物 Testing
LINE Corporation
 
GA Test Automation
LINE Corporation
 
UI Automation Test with JUnit5
LINE Corporation
 
Feature Detection for UI Testing
LINE Corporation
 
LINE 新星計劃介紹與新創團隊分享
LINE Corporation
 
​LINE 技術合作夥伴與應用分享
LINE Corporation
 
LINE 開發者社群經營與技術推廣
LINE Corporation
 
日本開發者大會短講分享
LINE Corporation
 
LINE Chatbot - 活動報名報到設計分享
LINE Corporation
 
在 LINE 私有雲中使用 Managed Kubernetes
LINE Corporation
 
LINE TODAY高效率的敏捷測試開發技巧
LINE Corporation
 
LINE 區塊鏈平台及代幣經濟 - LINK Chain及LINK介紹
LINE Corporation
 
LINE Things - LINE IoT平台新技術分享
LINE Corporation
 
LINE Pay - 一卡通支付新體驗
LINE Corporation
 
LINE Platform API Update - 打造一個更好的Chatbot服務
LINE Corporation
 
Keynote - ​LINE 的技術策略佈局與跨國產品開發
LINE Corporation
 
Ad

Recently uploaded (20)

PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 

Building Asynchronous Microservices with Armeria

  • 1. 이희승 (@trustin) / 開発1センター / LINE Building Asynchronous Microservices with Armeria Armeriaで始める非同期Microservice開発
  • 3. Asynchrony ● Most web frameworks are blocking and synchronous. – 1000 concurrent requests require 1000 threads. – In modern systems, a service sends requests to another backend. – Threads are busy doing nothing but just waiting for the backend. – Request queue is not consumed fast enough. – Result: ● Fragile system that falls apart even on a tiny backend failure ● Inefficient system that takes more memory and CPU than what it actually does
  • 4. Reactive Streams ● Should we really buffer everything until a response is sent? – Retrieving 100,000 rows from a table ● Why should a client send many requests to reduce the server memory pressure? – Retrieving 1,000 rows 100 times ● What if we want to stream infinitely? – Stock quotes ● Our protocol is not a problem here. – Our ‘blocking’ programming model is blocking ‘us’.
  • 5. Better RPC support ● RPC has been hardly a 1st-class citizen in web frameworks. – Distinction from RPC-level and HTTP-level failure – Access logs with RPC-level details – Debugging console ● What if … – We build a microservice framework with RPC at its core?
  • 6. More reasons back in 2015 ● Leverage Java 8 syntax – Lambda expressions – Default interface methods – Static interface methods ● Provide ‘working’ HTTP/2 implementation – ‘H2C’ support (HTTP/2 over ‘C’leartext) – OpenSSL-based faster TLS connection
  • 7. Better UX for devs ● This is the last yet most important part. ● Nobody wants a framework that’s hard to use. ● Can we design … – a user-friendly asynchronous programming API – … with modest learning curve?
  • 8. Our answer – Armeria ● HTTP/2 – Both ciphertext and cleartext, a.k.a. h2 and h2c ● Reactive – Implements Reactive Streams API ● Ability to mix different types of services in a single server – gRPC, Thrift, REST services – Legacy webapps via embedded Tomcat or Jetty ● High-performance – Netty with /dev/epoll transport and BoringSSL SSLEngine ● Easy to learn and fun to use (hopefully)
  • 11. Hello, world – Parameterized
  • 12. Hello, world – Annotated
  • 16. There are more! ● Query parameters ● Request and response converters ● Exception handlers ● Content type negotiation ● Regular-expression path mapping ● Aims to be on-par or better than <your favorite web framework>
  • 18. gRPC & Thrift basics a. Write an IDL file – .proto or .thrift b. A compiler compiles it into .java files. c. Implement interfaces generated at ‘b’.
  • 19. gRPC
  • 23. Intercepting a RPC request ● Complete access to the RPC call information ● Override the parameters and methods
  • 24. Decorator as core extension mechanism ● Request throttling ● Metric collection ● Distributed tracing (Zipkin) ● HTTP content encoding ● HTTP authn/z ● CORS ● Circuit breakers ● Automatic retries ● …
  • 25. Distributed tracing with Brave·Zipkin
  • 26. Playing better with RPC Armeria documentation service
  • 27. Armeria documentation service ● Enabled by adding DocService to ServerBuilder ● Browse and invoke RPC services in an Armeria server ● Supports both gRPC and Thrift ● We have a plan to add: – Support for plain HTTP, like Swagger – Metric monitoring console – Runtime configuration editor, e.g. logger level
  • 30. ● Share the URL to reproduce a call.
  • 31. All the pieces fit together The ultimate all-in-one micro(?) service
  • 34. Armeria client API ● Similar experience to the server-side API – e.g. Common type, Decorators, RPC-friendliness ● Client-specific stuff – Circuit breakers – Automatic retries – Client-side load balancing – Retrofit integration
  • 37. Let’s build Armeria together! ● Use it. ● Ask questions. ● Request new features. ● Tell us what rocks and sucks. ● Consider joining the effort.
  • 38. Meet us at GitHub and Slack ● https://github.com/line/armeria ● https://line-slacknow.herokuapp.com/line-armeria/