Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Knowledge drivenmicroservices

5,808 views

Published on

Knowledge driven micro services presentation from DevConf.cz 2016

Published in: Technology
  • Be the first to comment

Knowledge drivenmicroservices

  1. 1. Knowledge driven (micro) services JBCNConf 2016 Maciej Swiderski Principal Software Engineer @ JBoss
  2. 2. Where is knowledge? • While building application we tend to focus on • architecture • design - modules, UI etc • code quality • test cases • But where is business knowledge in this?
  3. 3. Business knowledge • Data model - the WHAT • XML • JSON • Java • Business rule definitions - the WHY • DRL • Business Process definitions - the HOW • BPMN2
  4. 4. Tools introduction •Vert.x •Hazelcast •Drools and jBPM
  5. 5. Vert.x in a Nutshell “Vert.x is a lightweight, high performance application platform for the JVM that's designed for modern mobile, web, and enterprise applications.”
  6. 6. Vert.x in a Nutshell • Polyglot use your favorite programming language or mix several to develop applications • Simplicity make use of asynchronous APIs without too much hassle • Scalability scales using message passing to efficiently utilize your server cores. • Concurrency simple actor-like concurrency model frees you from the pitfalls of traditional multi-threaded programming.
  7. 7. Hazelcast In memory data grid Clustered and highly available data distribution Distributed data structures
  8. 8. Vert.x topology Vert.x instance Verticle instance Verticle instance Vert.x instance Verticle instance Clustered Event Bus Verticle instance Event busEvent bus
  9. 9. Knowledge Is Everything • Open source projects for business systems automation and management • Drools • jBPM • OptaPlanner • UberFire • DashBuilder
  10. 10. Knowledge Archives - kjar • Business assets (data model, processes, rules, decision tables, forms, etc) are considered source artifacts • By that means they are packaged as source artifacts - as jars • Actually as kjars (knowledge archives) • single difference for kjar is the descriptor - kmodule.xml • kjar can contain java code as well, alternatively kjar can have dependencies to other (k)jars
  11. 11. Demo description • Applicant places a loan request • Bank qualifies given loan based on • potential risk of giving the loan • amount of the loan • duration of the loan • Bank representative approves or rejects the loan request
  12. 12. … into micro services Apply for loan service Evaluate loan service Process loan service
  13. 13. Apply for loan service • Main entry point to the loan request system • Allow applicant to put loan request that consists of: • applicant name • monthly income • loan amount • length in years to pay off the loan Here we provide the WHAT - our data model
  14. 14. Evaluate loan service • Rule based evaluation of incoming loan applications • Low risk loan • when loan request is for amount lower that 1000 it’s considered low risk and thus is auto approved • Basic loan • When amount is higher than 1000 and length is less than 5 years - requires clerk approval process • Long term loan • When amount is higher than 1000 and length is more that 5 years - requires manager approval and might need special terms to be established Here we provide the WHY - our business rules
  15. 15. Process loan service • Depending on the classification of the loan different bank departments/teams will be involved in decision making about given loan request • Basic loans department • performs background check on the applicant and either approves or rejects the loan • Long term loans department • requires management approval to ensure a long term commitment can be accepted for given application. Here we provide the HOW - our business processes
  16. 16. Our architecture Apply for loan service Evaluate loan service Process loan service Vert.x Event Bus powered by Hazelcast
  17. 17. How does it work? • Each service is completely self contained • Knowledge driven services are deployed with kjar • Services talks to each other by exchanging data - business data • Services can come and go as we like - dynamically increasing or decreasing number of instances of given service • no API in the strict sense of its meaning - API is the data
  18. 18. Demo • Deploy service with business processes • Basic Loan • Long term load • Deploy service with business rules • Deploy service that will place loan applications on behalf of different users • Java service • Java Script service • Groovy service
  19. 19. Our architecture… scaling Apply for loan service Evaluate loan service Process loan service Vert.x Event Bus powered by Hazelcast
  20. 20. Main take aways • Knowledge is everything • Keep in mind when building your services about • the WHAT • the WHY • the HOW • Always look at the business aspects of the solution you’re building…. technology, frameworks are just the tools
  21. 21. Knowledge driven micro services Questions?

×