While a microservices architecture is more scalable than a monolith, it has a direct hit on performance.
To cope with that, one performance improvement is to set up a cache. It can be configured for database access, for REST calls or just to store session state across a cluster of server nodes. In this demo-based talk, I’ll show how Hazelcast In-Memory Data Grid can help you in each one of those areas and how to configure it. Hint: it’s much easier than one would expect.
2. @nicolas_frankel
Me, myself and I
Former developer, team lead, architect,
blah-blah
Developer Advocate
Used to Enterprise stacks
3. @nicolas_frankel
Hazelcast
HAZELCAST IMDG is an operational,
in-memory, distributed computing
platform that manages data using
in-memory storage and performs
execution for breakthrough
and scale.
HAZELCAST JET is the ultra
fast, application embeddable,
3rd generation stream
processing engine for low
latency batch and stream
processing.
4. @nicolas_frankel
Microservices: a tentative definition
1. Componentization via Services
2. Smart endpoints and dumb pipes
3. Decentralized Governance
4. Decentralized Data Management
5. Infrastructure Automation
6. Design for failure
7. Evolutionary Design
8. Organized around Business Capabilities
9. Products not Projects
https://martinfowler.com/articles/microservices.html
7. @nicolas_frankel
Distributed systems
« You have to be in a really unusual spot to see in-process
function calls turn into a performance hot spot these days, but
remote calls are slow. If your service calls half-a-dozen
remote services, each which calls another half-a-dozen remote
services, these response times add up to some horrible
latency characteristics. »
-- https://martinfowler.com/articles/microservice-trade-offs.html
8. @nicolas_frankel
Fallacies of distributed computing
The network is reliable
Latency is zero
Bandwidth is infinite
The network is secure
Topology doesn't change
There is one administrator
Transport cost is zero
The network is homogeneous
https://yourlogicalfallacyis.com/
28. @nicolas_frankel
Hazelcast to the rescue!
1. Filter-based
2. Spring Session integration
3. Direct Tomcat integration
• Per-node configuration
• Or through Spring Boot embedded
4. Direct Jetty integration
30. @nicolas_frankel
Takeaways
Scalability and performance are not the same
Caching helps performance
• The cost is stale data
Hazelcast IMDG provides several integration-points for caching
across different areas
• Database access
• HTTP call
• Session data
31. @nicolas_frankel
Thanks for your attention!
https://blog.frankel.ch/
@nicolas_frankel
https://hazelcast.org/
https://bit.ly/micro-perf
Editor's Notes
@startuml
participant "a:A" as a
boundary "Layer X" as x
boundary "Layer Y" as y
boundary "Layer Z" as z
participant "b:B" as b
activate a
a -> x: call()
activate x
x -> y: call()
activate y
y -> z: call()
activate z
z -> b: call()
hide footbox
@enduml
participant "a:A" as a
boundary "Layer X" as x
boundary "Layer Y" as y
boundary "Layer Z" as z
participant "b:B" as b
activate a
a -> x: call()
activate x
x -> y: call()
activate y
y -> z: call()
activate z
z -> b: call()
z <-- b
y <-- z
deactivate z
x <-- y
deactivate y
a <-- x
deactivate x
deactivate a
skinparam dpi 300
hide footbox