0
Typesafe Stack SoftwareDevelopment On The JVMSushanta PradhanTalentica Software (I) Pvt. Ltd.
History of Hardware Architecture•   Single core era    • moores law achieved by increasing clock cycles•   Multi core era ...
Moore’s Law
PPP – Grand Challenge•   Parallel programming as easy as sequential    programming•   Moores’s law of performance – speed ...
History of software applications • pre .com era   • standalone desktop apps • .com era   • web sites - static web pages, a...
contd .. •   web2.0/semantic web era     • web/networked applications     • Smart apps     • data not controlled by vendor...
Properties of modern day App•   Scalability•   Distributed•   Parallel & Concurrent•   Dynamic•   Agile & Swift
Parallelism & Concurrency •   Parallel Programming     • parallel execution of programs     • cant be performed without pa...
Parallelism & Concurrency•   Concurrent Programming    • simultaneous execution of programs    • can be performed without ...
Why Hard?•   non-determinism due to shared mutable state by    concurrent threads•   encapsulate state in actors or transa...
Remedy?       PREVENTION IS BETTER THAN CURE !! •   Avoid mutable state and get deterministic processing •   Which means p...
Space vs TimeSpace(functional/parallel)    Time(imperative/concurrent)
Scala•   Hybrid – functional & object oriented (pure)•   strong static typing•   Agile - concise & expressive•   Parallel ...
Scala contd ..  Parallellism  • parallel collections  • distributed collections  Concurrency  • Actors  • STM             ...
Scala contd ..•   Concise Java•   Immutability Val & Var•   Tuples & Multiple Assignments•   Sensible Defaults•   Operator...
Scala classes ..•   Terse•   Object keyword - Singleton•   Companion Objects•   Type inference•   Option[T] – Some[T], None
Class hierarchy
Scala – Functional Aspects•   Functions too are objects•   Higher Order Functions•   Partially applied Functions•   Closures
Scala Inehritance•   Traits•   Mixins•   Type inference - implicit keyword
Scala collections•   Mutable & immutable•   filter()•   Map()•   foldLeft()•   foldRight()
Scala – Pattern Matching•   Advanced switch case•   Literals and constants•   WildCards•   Tuples & Lists•   Guards•   Reg...
Scala - Concurrency•   actor()•   Actor Class•   receive() & recieveWithin()•   react() & reachWithin()•   loop() & loopwh...
Akka - Middleware•   Concurrent, Scalable & fault-tolerant•   based on actor model•   highly performant•   event driven•  ...
Actor system•   ensemble of actors sharing common configuration•   hierarchical structure•   heavyweight•   has its own po...
Supervision•   dependency relationship between actors•   supervisor - subordinate model•   supervisor monitors and reacts ...
Supervision hierarchy                                ”root guardian”                        ”guardian”             shutdow...
Remoting•   ActorPath    • purely local - "akka://my-sys/user/service-a/worker1"    • local or remote - "akka://my-sys@hos...
Routing•   route messages to actors(routees)•   ideal for load balancing•   Examples    • RoundRobinRouter    • RandomRout...
Dispatchers•   make akka actors tick•   manages the resources(threads) used by actors•   configure mailboxes of actors•   ...
Play•   ruby on rails like agility•   convention over configuration•   seamless integration with akka for scalability•   e...
Play contd .. •   an easy, out-of-the-box setup for unit and functional testing •   asynchronous HTTP request handling •  ...
Progressive Stream Processing•   Iteratees•   Enumerators•   Enumeratees
Q/A
Upcoming SlideShare
Loading in...5
×

Indic threads pune12-typesafe stack software development on the jvm

590

Published on

The 7th Annual IndicThreads Pune Conference was held on 14-15 December 2012. http://pune12.indicthreads.com/

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
590
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Indic threads pune12-typesafe stack software development on the jvm"

  1. 1. Typesafe Stack SoftwareDevelopment On The JVMSushanta PradhanTalentica Software (I) Pvt. Ltd.
  2. 2. History of Hardware Architecture• Single core era • moores law achieved by increasing clock cycles• Multi core era • moores law achieved by increasing # of cores
  3. 3. Moore’s Law
  4. 4. PPP – Grand Challenge• Parallel programming as easy as sequential programming• Moores’s law of performance – speed up 2 times year on year• Eliminate concurrency bugs
  5. 5. History of software applications • pre .com era • standalone desktop apps • .com era • web sites - static web pages, automated business processes • data controlled by software vendor • deployed on data centers
  6. 6. contd .. • web2.0/semantic web era • web/networked applications • Smart apps • data not controlled by vendor but by the users • deployed on cloud
  7. 7. Properties of modern day App• Scalability• Distributed• Parallel & Concurrent• Dynamic• Agile & Swift
  8. 8. Parallelism & Concurrency • Parallel Programming • parallel execution of programs • cant be performed without parallel hardware • programs get faster
  9. 9. Parallelism & Concurrency• Concurrent Programming • simultaneous execution of programs • can be performed without parallel hardware • programs get more responsiveBoth are too hard !!
  10. 10. Why Hard?• non-determinism due to shared mutable state by concurrent threads• encapsulate state in actors or transactors but fundamental problems still remains non-determinism = parallel processing + mutable state
  11. 11. Remedy? PREVENTION IS BETTER THAN CURE !! • Avoid mutable state and get deterministic processing • Which means program functionally
  12. 12. Space vs TimeSpace(functional/parallel) Time(imperative/concurrent)
  13. 13. Scala• Hybrid – functional & object oriented (pure)• strong static typing• Agile - concise & expressive• Parallel & Sequential• intermixes well with Java
  14. 14. Scala contd .. Parallellism • parallel collections • distributed collections Concurrency • Actors • STM Akka • Futures
  15. 15. Scala contd ..• Concise Java• Immutability Val & Var• Tuples & Multiple Assignments• Sensible Defaults• Operator Overloading
  16. 16. Scala classes ..• Terse• Object keyword - Singleton• Companion Objects• Type inference• Option[T] – Some[T], None
  17. 17. Class hierarchy
  18. 18. Scala – Functional Aspects• Functions too are objects• Higher Order Functions• Partially applied Functions• Closures
  19. 19. Scala Inehritance• Traits• Mixins• Type inference - implicit keyword
  20. 20. Scala collections• Mutable & immutable• filter()• Map()• foldLeft()• foldRight()
  21. 21. Scala – Pattern Matching• Advanced switch case• Literals and constants• WildCards• Tuples & Lists• Guards• Regular Expressions
  22. 22. Scala - Concurrency• actor()• Actor Class• receive() & recieveWithin()• react() & reachWithin()• loop() & loopwhile()
  23. 23. Akka - Middleware• Concurrent, Scalable & fault-tolerant• based on actor model• highly performant• event driven• location transparency
  24. 24. Actor system• ensemble of actors sharing common configuration• hierarchical structure• heavyweight• has its own pool of resources threads
  25. 25. Supervision• dependency relationship between actors• supervisor - subordinate model• supervisor monitors and reacts to any errors reported by subordinates• configurable supervision strategy• lifecycle monitoring
  26. 26. Supervision hierarchy ”root guardian” ”guardian” shutdown “system guardian” order
  27. 27. Remoting• ActorPath • purely local - "akka://my-sys/user/service-a/worker1" • local or remote - "akka://my-sys@host.example.com:5678 /user/service-b"• Seamlessly send messages to actors on remote nodes
  28. 28. Routing• route messages to actors(routees)• ideal for load balancing• Examples • RoundRobinRouter • RandomRouter • SmallestMailboxRouter • BroadcastRouter
  29. 29. Dispatchers• make akka actors tick• manages the resources(threads) used by actors• configure mailboxes of actors• Examples • fork-join-executor • thread-pool-executor
  30. 30. Play• ruby on rails like agility• convention over configuration• seamless integration with akka for scalability• edit and test
  31. 31. Play contd .. • an easy, out-of-the-box setup for unit and functional testing • asynchronous HTTP request handling • WebSocket support • cache support (e.g. memcached) • integrated JSON and XML handling
  32. 32. Progressive Stream Processing• Iteratees• Enumerators• Enumeratees
  33. 33. Q/A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×