SCALE APPLICATIONS FLEXIBLY WITH MICROPROFILE Ondrej Mihályi @omihalyi
SCALABLE APPLICATIONS What it means? Another buzzword? @OMihalyi
HIGHLY SCALABLE APPLICATIONS !? Just great. Buzzword Bingo time! @OMihalyi
SERIOUSLY, WHAT ARE WE AFTER? The main Goal: add more resources to do the job faster. @OMihalyi
WHAT IS SCALABILITY Ability to improve with more resources Not straightforward More working hours ≠ more done More people on the job ≠ faster @OMihalyi
TYPES OF SCALING VERTICAL easy, brute force, often works inefficient, limited by physics HORIZONTAL enables higher scaling more complexity @OMihalyi
CHALLENGES OF HORIZONTAL SCALING distributed programming increased communication shared state @OMihalyi
SCALING WITH MICROSERVICES Microservices HELP with scaling granular scaling of critical parts But... LOT MORE MOVING PARTS AND COMPLEXITY communication bottlenecks are still a problem @OMihalyi
WHAT IS MICROPROFILE? open-source specification for Java microservices ( microprofile.io ) @OMihalyi
MICROPROFILE HELPS WITH COMPLEXITY unified Config API service metrics & health passing security context tracing of distributed requests recovery from network failures @OMihalyi
AVOIDING BOTTLENECKS AMDAHL'S LAW : Speedup limited by the parts that don't benefit from added resources bottlenecks: sequential tasks, synchronization, communication @OMihalyi
IN-MEMORY DATAGRIDS distributed shared state (memory) distrib. communication (locks, messaging, ...) simple distrib. structures (map, set, queue, ...) sophisticated algorithms behind the scenes data replication and even distribution auto-discovery of nodes @OMihalyi
PAYARA SERVER derived from GlassFish Java EE Server MicroProfile 1.3 embedded Hazelcast JCache API, session replication message bus over CDI events @OMihalyi
PAYARA MICRO shares codebase with Payara Server can cluster with Payara Server runs WAR from command line embeddable, uber JAR @OMihalyi
SCALE UP! Once an app is designed for flexible clustering, it becomes elastic - easily adaptable to increasing load. @OMihalyi
DEMO TIME
#1 MULTIPLICATION Additional instances more CPUs and other resources Simple load balancer is enough data is shared automatically @OMihalyi
#2 SCALING MEMORY Data access is often a bottleneck → Keep data in memory Additional instances with no apps Dumb nodes carrying data Increase available memory Increase resilience to outages @OMihalyi
#2 SCALING MEMORY
#3 SEPARATING DATA FROM LOGIC more data → more heap and time in GC run critical apps on LITE NODES slower data access but less GC cycles tweak GC & heap for throughput run small devices on LITE NODES @OMihalyi
#2 SCALING MEMORY
#3 SEPARATING DATA FROM LOGIC
#4 SCALE PARTS SEPARATELY
#4 MESSAGING TO BALANCE LOAD
#4 SCALE APP PARTS SEPARATELY some parts of an app are bottlenecks split those into separate services can be scaled higher use data grid for communication small and lean services with Payara Micro @OMihalyi
HAZELCAST MEMORY UTILIZATION Replicated up to X nodes Data evenly distributed Lite nodes without data Off-heap data (enterprise) @OMihalyi
OTHER HAZELCAST FEATURES Auto discovery and recovery multicast, TCP and cloud joiners data redistribution when nodes join/leave Distributed cache (JCache API) Distributed queries and ExecutorService @OMihalyi
ANYTHING TO ASK? Thank you
RESOURCES source code: OndrejM-demonstrations/scaling- with-datagrids an article about flexible clustering MicroProfile: microprofile.io Payara: payara.fish payara.org , @OMihalyi
Recommend
More recommend