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

Proud to be polyglot (persistence and programming)

Tugdual Grall
November 07, 2014

Proud to be polyglot (persistence and programming)

New developers and teams are now polyglot :
- they use multiple programming languages (Java, Javascript, Ruby, ...)
- they use multiple persistence store (RDBMS, NoSQL, Hadoop)
In this talk you will learn about the benefits if being polyglot: use the good language or framework for the good cause, select the good persistence for specific constraints.
This presentation will show how developer could mix the Java platform with other technologies such as NodeJS and AngularJS to build application in a more productive way. This is also the opportunity to talk about the new Command Query Responsibility Segregation (CQRS) pattern to allow developers to be more effective and deliver the proper application to the user quicker.

This presentation was delivered during Devfest Nantes 2014

Tugdual Grall

November 07, 2014
Tweet

More Decks by Tugdual Grall

Other Decks in Technology

Transcript

  1. • Modern Applications Must Manage any type of data Scale

    Be fault tolerant Adapt to change Modern Applications
  2. • Mono-Technology • Single “language/architecture” • Single Database : RDBMS

    • One size fits all approach Current Architecture JSP/JSF   Services   Messaging   JTA   DAO/JPA
  3. Is it good for me? • Many files • XML,

    Sources, .. • Does Hibernate/JPA is good for all? • Impedance mismatch • Need to scale • from 0 to 50millions users in 6 weeks • How to add new features easily? • changing code, updating data structure, ... • and all this for yesterday!
  4. Stay up! .  .  . Application Scale out Add more

    “Web” servers RDBMS Scale Up Get bigger server RDBMS App  Server
  5. Scaling out RDBMS .  .  . App  Server .  .

     . Memcached .  .  . MySQL • Run Many SQL Servers • Data could be sharded • Done by the application code • Caching Layer
  6. NoSQL to Scale out! .  .  . Application Scale out

    Add more “Web” servers NoSQL Scale Out Add more servers NoSQL App  Server .  .  .
  7. Polyglot Persistence Big  Data/Analysis Document RDBMS • Log  Capture  

    • Recommendations   • Predictions   • Ad  Campaign • Products   • User  Profiles   • Game  Actions   • Sessions   • Shopping  Cart • Financial  Data   • Reporting
  8. • Understand the pros/cons of each solutions – Programming API

    – How to access the data? (API, Query Languages) • Learn how to design data model – De-normalizing and duplicate data is not a problem • Integrate each solution to your application • Note: This is something you already do ! – Operational RDBMS and Data Warehouse Developer New Skills
  9. • Wrap data call in Services – loosely coupled Data

    Service Layer .  .  . App  Server
  10. Use Case : Mobile / API PIM Database • Legacy

    Application • Product Information NoSQL • REST API • Product Data • Additional Metadata
  11. Why multiple languages? • Sometimes we have no choice –

    HTML/CSS/JavaScript + Server Side – Mobile Native Applications • Java/.Net are slow movers – Java EE 5.0 is still mainstream (2006) • Many languages and frameworks – Scala, Clojure, Groovy, Dart, Go, Ruby, Python, F#, Erlang, Node.js, Rails, Play!, Grails, ...
  12. • Realtime interaction with WebSockets : – Wait for Java

    EE 7 to supported by your IT? – Hack your app server and application with Continuation ? – Use Node.js and Socket.io ? • Data Collection and Treatment? – Find a library? – Create your library? – Use Java 8 and Lambdas? – Use Scala? Examples
  13. • Simple CRUD Application – Use the JavaEE stack with

    JPA and JSF? – Use Spring ? – Use tools like Play!, Grails, Rails, MEAN ? Examples
  14. • Build a new database – Save and retrieve data

    on disk – Cache the data on RAM – Build a query engine – Build replication and sharding – Build a Monitoring engine & console – Build a Backup/Restore Solution Polyglot Programming in Action
  15. • Data access, caching, and replication – C/C++ is the

    fastest way to interact with I/O – Leverage existing Caching layer & I/O – memory-mapped file • Query & Indexing – Leverage C/C++, and expose native JS engine • Management – Web Console : Java & HTML/CSS – Agent : GoLang Polyglot Programming in Action
  16. Use Case : Second Screen Experience .  .  . Node.js

     +  Socket  IO Play!  ApplicaIon   Python  Scripts
  17. Conclusion • Use the good tool for the good task

    – Do not try to “hack” something when you have a simpler solution – Think about your users first... so deliver and get feedback • Learning is part of our job ! – And this will help you and your project • What about maintenance? – Do you think it is easier to maintain complex code?