Lessons Learned : Improving Performance and Resilience in Blibli.com Store Front
Slides from our talk about our journey in increasing performance using completable future, guava, and rx java at JVM Meetup #9 & Tech It Easy @ Blibli.com
to specific end point that we want to improve – Identify which services that blocking / problematic • Possible Solution : – Move some services that high load to ajax – Make some services to asynchronous – Caching some services that high load – Make thread separated from tomcat
from multiple services • Each service can take some time to give response Solution : • Make those service call (independent from other services) asynchronous using CompletableFuture
its value and status), and may be used as a CompletionStage, supporting dependent functions and actions that trigger upon its completion. - Java documentation Completable Future
front serve content mainly from service • High response time during high concurrent request to backend services (cms, etc) • Mostly same content Solution : • Cache it using Guava!
core library and it provide an in memory cache. Why Guava cache ? - It provide us interface to populate cache and its behavior - We are willingly to spend our memory to improve the speed - We have many keys that called repetitively
to execute same process with exact parameters – No need for network connection – Can handle huge content – Can handle complex cache key • Cons – Consume RAM – Local Cache, duplicate between nodes
key loads a new value for the key, possibly asynchronously • The old value (if any) is still returned while the key is being refreshed • If an exception is thrown while refreshing, the old value is kept, and the exception is logged and swallowed
and refresh a new value asynchronously – Keep the old value when refreshing fails • Cons – Not getting the newest value even the time expires (need to wait the refresh to successfully retrieve new value) – Value will always remain on RAM