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

Proud to be polyglot (persistence and programming)

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. DevFest
    Tugdual Grall
    Technical Evangelist
    [email protected]
    @tgrall

    View Slide

  2. Proud to be Polyglot!
    Tugdual Grall
    Technical Evangelist
    [email protected]
    @tgrall

    View Slide

  3. • Modern Applications Must
    Manage any type of data
    Scale
    Be fault tolerant
    Adapt to change
    Modern Applications

    View Slide

  4. • Mono-Technology
    • Single “language/architecture”
    • Single Database : RDBMS
    • One size fits all approach
    Current Architecture
    JSP/JSF  
    Services  
    Messaging  
    JTA  
    DAO/JPA

    View Slide

  5. 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!

    View Slide

  6. One size does NOT fit all!

    View Slide

  7. Look at our data….

    View Slide

  8. Big Data

    View Slide

  9. Big Users
    http://www.theconnectivist.com/    &  Cisco

    View Slide

  10. Stay up!
    .  .  .
    Application
    Scale out
    Add more “Web” servers
    RDBMS
    Scale Up
    Get bigger server
    RDBMS
    App  Server

    View Slide

  11. Scaling out RDBMS
    .  .  .
    App  Server
    .  .  .
    Memcached
    .  .  .
    MySQL
    • Run Many SQL Servers
    • Data could be sharded
    • Done by the application
    code
    • Caching Layer

    View Slide

  12. NoSQL to Scale out!
    .  .  .
    Application
    Scale out
    Add more “Web” servers
    NoSQL
    Scale Out
    Add more servers
    NoSQL
    App  Server
    .  .  .

    View Slide

  13. Operational vs Analytics Databases
    Warehouse, Analytics
    Applications, Interactions

    View Slide

  14. Polyglot Persistence
    Big  Data/Analysis Document RDBMS
    • Log  Capture  
    • Recommendations  
    • Predictions  
    • Ad  Campaign
    • Products  
    • User  Profiles  
    • Game  Actions  
    • Sessions  
    • Shopping  Cart
    • Financial  Data  
    • Reporting

    View Slide

  15. • 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

    View Slide

  16. • Wrap data call in Services
    – loosely coupled
    Data Service Layer
    .  .  .
    App  Server

    View Slide

  17. Use Case : Personalization
    WebSite  /  Application
    Personalization Database
    Data Processing
    Logs
    Logs
    Application
    Data

    View Slide

  18. Use Case : Mobile / API
    PIM Database
    • Legacy Application
    • Product Information
    NoSQL
    • REST API
    • Product Data
    • Additional Metadata

    View Slide

  19. Now  What?

    View Slide

  20. 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, ...

    View Slide

  21. • 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

    View Slide

  22. • Simple CRUD Application
    – Use the JavaEE stack with JPA and JSF?
    – Use Spring ?
    – Use tools like Play!, Grails, Rails, MEAN ?
    Examples

    View Slide

  23. • Maturity/Supportability
    • Features Set
    • Learning Curve
    • Productivity
    How to chose?

    View Slide

  24. • 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

    View Slide

  25. • 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

    View Slide

  26. MongoDB & MMS

    View Slide

  27. Use Case : Second Screen Experience
    .  .  .
    Node.js  +  Socket  IO
    Play!  ApplicaIon  
    Python  Scripts

    View Slide

  28. Demonstration
    Sentiment  Analysis

    View Slide

  29. 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?

    View Slide

  30. Tugdual Grall
    Technical Evangelist
    [email protected]
    @tgrall
    Questions?

    View Slide