scala - In Slick 3.0, why is the newly-introduced `Streaming` useful? -


i found slick 3.0 introduced new feature called streaming

http://slick.typesafe.com/doc/3.0.0-rc1/database.html#streaming

i'm not familiar akka. streaming seems lazy or async value, not clear me understand why useful, , when useful..

does have ideas this?

so lets imagine following use case:

a "slow" client wants large dataset server. client sends request server loads data database, stores in memory , passes down client.

and here we're faced problems: client handles data not fast wanted => can't release memory => may result in out of memory error.

reactive streams solve problem using backpressure. can wrap slick's publisher around akka source , "feed" client via akka http.

the thing backpressure propagated through tcp via akka http down publisher represents database query.

that means read database fast client can consume data.

p.s little aspect reactive streams can applied.

you can find more information here:


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -