How to manage a large file with HTTP? Is it possible to manage data stream when you are in a HTTP POST request? How to be relax when managing data stream (ie : not use while(true) hack or something I/O block)?
This talk is about Play! iteratee and how to use it on real project : what is an iteratee? why it's useful? how to use it? how to manage it? is it clean? is your code readable or not?
http://scaladays.org/#schedule/How-to-manage-large-amounts-of-data-with-Iteratee
12. WHAT IS INSIDE AN
HTTP REQUEST ?
Verb
• The action
Resource
• The object of the action
Headers
• The context of the action
Body
• Optional
• The datas
13. IN MANY CASE THE REQUEST IS
MANIPULATE ALL FROM MEMORY
23. CLASSIC JAVA STREAM
MANAGEMENT
• Low performances if not buffered
• Not modular
• Thread blocking
• Code is ugly
• No back pressure
• Error handling is bad
• i/o management and business code are mixed
58. DO NOT USE THE FILE
SYSTEM AS A DATASTORE
File system are POSIX compliant
• POSIX is ACID
• POSIX is powerful but is a bottleneck
• File System is the nightmare of ops
• File System creates coupling (host provider/OS/language)
• SPOF-free multi tenant File System is a unicorn
59. • Key = hash of the chunk
STORE FILE IN CHUNK INSIDE K/V
STORE
61. PROCESS
File is post
by browser
Stream is
chunk
nomalized
Each chunk
is async
store in kv
List of chunk
hash is store
with file id
No overhead
for data
store
66. I’m @waxzce on twitter
I’m the CEO of
A PaaS provider, give it a try
;-)
THX FOR LISTENING
& QUESTIONS TIME
Coupon for Clever Cloud trial :
berlin_scala_days