"The big question is whether you are going to
be able to say a hearty yes to your adventure”
Joseph Campbell
Slide 2
Slide 2 text
Java EE Monolith to
Cloud-Ready Architecture:
Lessons from the Drools/jBPM Ecosystem
Eder Ignatowicz
Sr. Software Engineer @ Red Hat
Alex Porcelli
Principal Software Engineer @ Red Hat
Slide 3
Slide 3 text
The Hero’s Journey
Slide 4
Slide 4 text
Business Central Usability
Call to Adventure
Slide 5
Slide 5 text
Threshold
Slide 6
Slide 6 text
First Trial
Slide 7
Slide 7 text
Second Trial
Slide 8
Slide 8 text
Abyss
Slide 9
Slide 9 text
Supernatural aid
Slide 10
Slide 10 text
Transformation
Slide 11
Slide 11 text
Transformation
Slide 12
Slide 12 text
Transformation
Slide 13
Slide 13 text
Return
Slide 14
Slide 14 text
Rest
Slide 15
Slide 15 text
Hero’s Journey
Slide 16
Slide 16 text
Cloud readiness
Call to Adventure
Slide 17
Slide 17 text
git repository
BC
Helix
Zookeeper
...
Business Central
Cluster Nodes
Threshold - 2016
BC
Helix
Zookeeper
git repository
Java NIO2
Git Implementation
Java NIO2
Git Implementation
Slide 18
Slide 18 text
Supernatural aid
Slide 19
Slide 19 text
FileSystem Scalability
First Trial
Slide 20
Slide 20 text
First Trial
NIO2 Git Implementation
• fsService.newFileSystem(“git://examples”));
• Internally we store one project per git repo
• default://project
• .niogit/project.git (physical)
• Backed by SAN, NFS or a distributed FS
• Advantages
• Standard Java API (NIO2)
• Designed to VFS (could support multiple NIO2
implementations)
• Perfect fit with our business needs.
Slide 21
Slide 21 text
First Trial
NIO2 Git Implementation
• Challenges
• Every project is an instance of a NIO2 filesystem
• Instantiate filesystem objects is heavyweight so, we keep all
them in memory.
• Multiple users, multiple projects
• users*projects in memory
• First trial:
• Reduce the memory footprint
Slide 22
Slide 22 text
First Trial
Lazy Engine for NIO2 file system
Patent Pending (LAZY VIRTUAL FILESYSTEM INSTANTIATION AND CACHING 0816028.00258)
Slide 23
Slide 23 text
Messaging
Second Trial
Slide 24
Slide 24 text
Second Trial
Watch Service Events
• All the business central git operations mapped to WatchService
NIO2 Events
• ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY,
ENTRY_RENAME
• How to replicate this event on all nodes?
Slide 25
Slide 25 text
...
...
Artemis cluster
Business
Central
Cluster
Business
Central
Business
Central
Business
Central
Second Trial
ENTRY_CREATE
Regenerated
Watch event
ENTRY_CREATE
Watch event
Slide 26
Slide 26 text
Indexing
Third Trial
Slide 27
Slide 27 text
Third Trial
Indexing
• What to index
• Efficiently list all content of git repositories
• Support different architectures
• Support text search for large repositories
• 10.000’s of assets
• Third trial:
• Implement an efficient indexing strategy for the platform
Slide 28
Slide 28 text
Third Trial
Indexing
• When to index
• Watch Service listening all NIO2 Watch Events
• How to index:
• Index instead of list repository content
• Plugable Engines
• Lucene (local)
• Infinispan (distributed in memory)
• ElasticSearch (distributed and persisted)
Slide 29
Slide 29 text
Two new challenges appears
Abyss
Slide 30
Slide 30 text
CDI Event Distribution
Abyss Trial 1
Slide 31
Slide 31 text
CDI Events on Cluster
CDI Events Cluster Propagation
• Challenges
• We rely on CDI event distribution for everything
• Backend messaging
• UI events via Errai Framework (CDI in the Browser)
• (full web architecture on http://ederign.me - 5 pillars)
• Becomes really hard to sync everything on cluster
• Duplicated code
• UI Logic that works only a single instance
• New trial:
• How to distribute my CDI events?
Slide 32
Slide 32 text
CDI Events on Cluster
@Portable
@Clustered
public class NewProjectEvent {
private WorkspaceProject workspaceProject;
public NewProjectEvent(final WorkspaceProject workspaceProject) {
this.workspaceProject = workspaceProject;
}
public WorkspaceProject getWorkspaceProject() {
return workspaceProject;
}
}
Slide 33
Slide 33 text
CDI Events on Cluster
public void observeAllEvents(@Observes(notifyObserver = Reception.IF_EXISTS)
Object event,
EventMetadata metaData) {
if (shouldObserveThisEvent(event,metaData)) {
broadcastOnCluster(event);
}
}
Slide 34
Slide 34 text
CDI Events on Cluster
Slide 35
Slide 35 text
Maven
Abyss Trial 2
Slide 36
Slide 36 text
Build System
Proprietary Build System
• Challenges
• Incremental compilation
• In-process execution
• Shared ClassLoader
• Multiple users building at same time
on the same process
• Output of a project is a kjar (.jar) to be
deployed into a kie-server
• New trial:
• How to make this build efficient and cloud
friendly?
Slide 37
Slide 37 text
Build System
Maven Based Build
• How to
• Adopt and Adapt Maven to
• Incremental compilation
• Low memory footprint
• Multi-thread/Async API
• Multi-user/multi-m2repo
• µService/cloud native
• Embedded & off-process
• New trial:
• DEV5074 - Turning Maven into a Highly Scalable, Resource-Efficient,
Cloud-Ready Microservice
• Moscone West - Room 2018
• Wednesday 4pm
Slide 38
Slide 38 text
Rest
Slide 39
Slide 39 text
SaaS (Hosted Business Central)
Call to Adventure
Slide 40
Slide 40 text
Java Hero’s
Slide 41
Slide 41 text
"The big question is whether you are going to
be able to say a hearty yes to your adventure”
Joseph Campbell
Slide 42
Slide 42 text
Tech Supernatural aid
Slide 43
Slide 43 text
Thank you.
Eder Ignatowicz
Sr. Software Engineer
Red Hat
Alex Porcelli
Principal Software Engineer
Red Hat