Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java EE Monolith to Cloud-Ready Architecture: Lessons from the Drools/jBPM Ecosystem

Java EE Monolith to Cloud-Ready Architecture: Lessons from the Drools/jBPM Ecosystem

We’ve heard a lot of hype about microservices and why we all should embrace them and design our software as suites of independently deployable services. However, it is common sense that there is a significant trade-off between this architectural style and effectively splitting existing monoliths. This session shows how the Java EE programming model significantly enables decoupling monoliths; how to distribute this programming model in a cloud-ready environment; the challenges related to this migration in the Drools/jBPM ecosystem; and how and why Red Hat has to redesign its cluster technology, file systems, CDI event distribution, web stack, and Maven as microservices.

Eder Ignatowicz

November 01, 2018
Tweet

More Decks by Eder Ignatowicz

Other Decks in Programming

Transcript

  1. "The big question is whether you are going to be

    able to say a hearty yes to your adventure” Joseph Campbell
  2. 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
  3. git repository BC Helix Zookeeper ... Business Central Cluster Nodes

    Threshold - 2016 BC Helix Zookeeper git repository Java NIO2 Git Implementation Java NIO2 Git Implementation
  4. 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.
  5. 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
  6. First Trial Lazy Engine for NIO2 file system Patent Pending

    (LAZY VIRTUAL FILESYSTEM INSTANTIATION AND CACHING 0816028.00258)
  7. 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?
  8. ... ... Artemis cluster Business Central Cluster Business Central Business

    Central Business Central Second Trial ENTRY_CREATE Regenerated Watch event ENTRY_CREATE Watch event
  9. 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
  10. 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)
  11. 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?
  12. 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; } }
  13. CDI Events on Cluster public void observeAllEvents(@Observes(notifyObserver = Reception.IF_EXISTS) Object

    event, EventMetadata metaData) { if (shouldObserveThisEvent(event,metaData)) { broadcastOnCluster(event); } }
  14. 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?
  15. 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
  16. "The big question is whether you are going to be

    able to say a hearty yes to your adventure” Joseph Campbell
  17. Thank you. Eder Ignatowicz Sr. Software Engineer Red Hat Alex

    Porcelli Principal Software Engineer Red Hat