Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Play Framework
Search
Eko Kurniawan Khannedy
March 14, 2016
Technology
2
190
Play Framework
Sharing Session Play Framework
Eko Kurniawan Khannedy
March 14, 2016
Tweet
Share
More Decks by Eko Kurniawan Khannedy
See All by Eko Kurniawan Khannedy
Monolith to Event-Driven Microservices
khannedy
1
240
Refactoring
khannedy
0
300
Multi-Datacenter Kafka at Blibli.com
khannedy
2
1.5k
QA Tools - Research and Development
khannedy
0
270
Reactive Puzzle
khannedy
0
190
Event-Driven Architecture
khannedy
1
1.8k
Resilience Engineering with Hystrix and Spring
khannedy
1
550
Mocking for Unit Test using Mockito
khannedy
1
320
Centralized Configuration using Consul and Spring Cloud
khannedy
2
630
Other Decks in Technology
See All in Technology
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
9
1.1k
AIチャットボット開発への生成AI活用
ryomrt
0
170
プロダクト活用度で見えた真実 ホリゾンタルSaaSでの顧客解像度の高め方
tadaken3
0
150
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
380
Engineer Career Talk
lycorp_recruit_jp
0
180
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
OS 標準のデザインシステムを超えて - より柔軟な Flutter テーマ管理 | FlutterKaigi 2024
ronnnnn
0
170
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
420
組織成長を加速させるオンボーディングの取り組み
sudoakiy
2
180
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Ruby is Unlike a Banana
tanoku
97
11k
Unsuck your backbone
ammeep
668
57k
Bash Introduction
62gerente
608
210k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Transcript
PLAY FRAMEWORK EKO KURNIAWAN KHANNEDY
EKO KURNIAWAN KHANNEDY ▸ Principal Software Development Engineer at blibli.com
▸ Part of Research and Development Team ▸
[email protected]
PLAY FRAMEWORK
INTRO PLAY FRAMEWORK
IF YOU ARE JAVA DEVELOPER
THIS IS YOUR LIFE
PLAY FRAMEWORK WAITING…
PLAY FRAMEWORK XMHELL
PLAY FRAMEWORK TAIL -F APPLICATION.LOG
PLAY FRAMEWORK THREAD POOL HELL
PLAY FRAMEWORK :(
THERE IS A BETTER WAY
PLAY FRAMEWORK A MODERN WEB FRAMEWORK FOR JAVA AND SCALA
PLAY FRAMEWORK OUTLINE ▸ Getting Started ▸ Hot Reload ▸
Error Handling ▸ Threaded & Evented ▸ Non Blocking IO ▸ Performance
GETTING STARTED PLAY FRAMEWORK
PLAY FRAMEWORK PLAY FRAMEWORK
PLAY FRAMEWORK INSTALLING
PLAY FRAMEWORK ACTIVATOR NEW
PLAY FRAMEWORK APP STRUCTURE
PLAY FRAMEWORK IDE
PLAY FRAMEWORK ACTIVATOR RUN
PLAY FRAMEWORK LOCALHOST:9000
PLAY FRAMEWORK OUTLINE ▸ Getting Started ▸ Hot Reload ▸
Error Handling ▸ Threaded & Evented ▸ Non Blocking IO ▸ Performance
HOT RELOAD PLAY FRAMEWORK
PLAY FRAMEWORK CREATE NEW CONTROLLER AND ACTION
PLAY FRAMEWORK ROUTING
NOW, RESTART THE SERVER
None
PLAY FRAMEWORK HOT RELOAD
PLAY FRAMEWORK LOCALHOST:9000/HELLO
PLAY FRAMEWORK OUTLINE ▸ Getting Started ▸ Hot Reload ▸
Error Handling ▸ Threaded & Evented ▸ Non Blocking IO ▸ Performance
ERROR HANDLING PLAY FRAMEWORK
PLAY FRAMEWORK ADD NEW PARAMETER
PLAY FRAMEWORK CHANGE ROUTING
PLAY FRAMEWORK BAD REQUEST
PLAY FRAMEWORK OK
PLAY FRAMEWORK MAKE MISTAKE
PLAY FRAMEWORK COMPILE ERROR
PLAY FRAMEWORK NOT FOUND
PLAY FRAMEWORK ADD A VIEW
PLAY FRAMEWORK THE REAL VIEW
PLAY FRAMEWORK CHANGE CONTROLLER
PLAY FRAMEWORK LOCALHOST:9000/HELLO
PLAY FRAMEWORK VIEW ERROR
PLAY FRAMEWORK OUTLINE ▸ Getting Started ▸ Hot Reload ▸
Error Handling ▸ Threaded & Evented ▸ Non Blocking IO ▸ Performance
THREADED VS EVENTED PLAY FRAMEWORK
PLAY FRAMEWORK MOST PEOPLE ARE USED THREADED SERVER
THREADED SERVERS ASSIGN ONE THREAD PER REQUEST AND USE BLOCKING
I/O PLAY FRAMEWORK
PLAY FRAMEWORK EVENTED SERVERS ARE GAINING POPULARITY
EVENTED SERVERS HAVE ONE THREAD/ PROCESS PER CPU CORE AND
USE NON- BLOCKING I/O PLAY FRAMEWORK
WHY THREADED VS EVENTED MATTERS FOR US PLAY FRAMEWORK
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE
PLAY FRAMEWORK MICROSERVICES
PLAY FRAMEWORK THREADED DILEMMA ▸ Create new thread is expensive.
▸ Use a thread pool. ▸ Too many threads in thread pool. ▸ Memory overhead. ▸ Context switching overhead. ▸ Too few threads in thread pool. ▸ Run out of threads, latency goes up. ▸ Sensitive to timeout.
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE LET’S SAY LATENCY GOES UP HERE
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE THREAD BLOCKED HERE
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE LATENCY GOES UP HERE
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE THREAD BLOCKED HERE
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE AND HERE
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE HERE TOO
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE AND THERE
PLAY FRAMEWORK MICROSERVICES LOAD BALANCER INTERNET FRONTEND SERVER FRONTEND SERVER
FRONTEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER BACKEND SERVER DATABASE DATABASE DATABASE AND THERE UPS JANGAN PANIK
PLAY FRAMEWORK PLAY FRAMEWORK Play Framework is build on top
Netty and Akka, so it supports non-blocking I/O.
PLAY FRAMEWORK NIO BENEFITS ▸ No sensitive to downstream slowness.
▸ Easy to parallelize I/O ▸ Support many concurrent and long-running connections, enabling : ▸ WebSocket ▸ Comet ▸ Server-Sent Events
PLAY FRAMEWORK OUTLINE ▸ Getting Started ▸ Hot Reload ▸
Error Handling ▸ Threaded & Evented ▸ Non Blocking IO ▸ Performance
NON BLOCKING I/0 PLAY FRAMEWORK
PLAY FRAMEWORK NON BLOCKING HTTP CLIENT
A FUTURE[T] WILL EVENTUALLY CONTAIN THE VALUE T (OR AN
ERROR) PLAY FRAMEWORK
PLAY FRAMEWORK NON BLOCKING HTTP CLIENT
PLAY FRAMEWORK ROUTING
PLAY FRAMEWORK RESULT
WE JUST BUILD COMPLETELY NON BLOCKING PROXY PLAY FRAMEWORK
PLAY FRAMEWORK LET’S PROVE IT
PLAY FRAMEWORK LET’S PROVE IT
NIO MAKE PARALLEL REQUEST EASY. LET’S TRY IT PLAY FRAMEWORK
PLAY FRAMEWORK PARALLEL IN NIO
PLAY FRAMEWORK PARALLEL IN NIO
PLAY FRAMEWORK PARALLEL IN NIO
PLAY FRAMEWORK PARALLEL IN NIO
PLAY FRAMEWORK OUTLINE ▸ Getting Started ▸ Hot Reload ▸
Error Handling ▸ Threaded & Evented ▸ Non Blocking IO ▸ Performance
PERFORMANCE PLAY FRAMEWORK
IS PLAY FRAMEWORK WEB SCALE? PLAY FRAMEWORK
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
THEORETICAL MAXIMUM PERFORMANCE FOR THE SERVER IN IDEAL CONDITIONS. Raw
Horsepower PLAY FRAMEWORK
PERFORMANCE WITH MANY USERS, I/O, AND MORE REAL-WORLD SCENARIOS. Concurrent
Horsepower PLAY FRAMEWORK
HOW EASY IT IS TO GET STARTED, HOW QUICKLY A
SINGLE DEVELOPER CAN BUILD THINGS Single Developer PLAY FRAMEWORK
HOW THE FRAMEWORK TOLERATES MANY DEVELOPERS WORKING CONCURRENTLY Multiple Developers
PLAY FRAMEWORK
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
PLAY FRAMEWORK RAW HORSEPOWER CONCURRENT HORSEPOWER MULTIPLE DEVELOPERS SINGLE DEVELOPER
PRODUCTION ONE MORE THING
PLAY FRAMEWORK ACTIVATOR DIST
PLAY FRAMEWORK DISTRIBUTION FILE
PLAY FRAMEWORK DISTRIBUTION STRUCTURE
PLAY FRAMEWORK OR SPECIFIC OPERATING SYSTEM ▸ windows:packageBin ▸ universal:packageOsxDmg
▸ debian:packageBin ▸ rpm:packageBin ▸ docker:publishLocal
PLAY FRAMEWORK OS X DISTRIBUTION FILE
PLAY FRAMEWORK RUNNING ON SERVER
PLAY FRAMEWORK PLAY ON PRODUCTION
PLAY FRAMEWORK PLAY ON PRODUCTION
PLAY FRAMEWORK PLAY ON PRODUCTION
PLAY FRAMEWORK PLAY ON PRODUCTION
THANKS
PLAY FRAMEWORK REFERENCES ▸ http://www.slideshare.net/brikis98/the-play-framework-at-linkedin ▸ https://www.playframework.com ▸ http://netty.io ▸
http://akka.io ▸ https://www.lightbend.com/activator/download ▸ http://zeroturnaround.com/rebellabs/java-ee-productivity-report-2011/