Your SlideShare is downloading. ×
December 4 SDForum Java Sig Presentation
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

December 4 SDForum Java Sig Presentation


Published on

December 4 SDForum Java Sig Presentation - Jonathan Abrams

December 4 SDForum Java Sig Presentation - Jonathan Abrams

Published in: Technology, Education

  • yes the Java world is over complex for sure. Part of that is the price of the power and flexibility you get with all the Java technologies. Part of it is that Java is a lot older (at least in terms of popular usage) than PHP, Ruby, or Python (none of which I remember hearing about back in say 1996 when I worked as an engineer in Netscape's Java group). In ten years, there might be 10 confusingly overlapping frameworks for Ruby too...<br /><br/>
    Are you sure you want to  Yes  No
    Your message goes here
  • This is a great presentation, and a nice reality check for Ruby / Php people. Obviously Java scales fine if you do it right ... the problem is that there is so much complexity in the Java world, and the culture of Java programmers often emphasizes other things (code maintainability, I18N, pretty design patterns, etc) besides scaling. So you have to dig a bit deeper than in the php / ruby world before you even find out about stuff like memcached!

    There's probably a book in here somewhere about building consumer internet sites in Java. Not that you want to write a book, but somebody should.<br /><br/>
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Jonathan Abrams SDForum Java SIG December 4, 2007 Building High-Traffic Java-Based Web Applications
  • 2. Popular Languages for Web Apps
    • Ruby/RoR
      • Hot & trendy!
      • Many small web 2.0 startups
      • Unknown scalability (Twitter)
    • PHP
      • Facebook, Friendster, Yahoo
      • Proven and very popular
      • No connection pooling?
      • Page-oriented, not usually MVC?
      • Maintainability?
    • Python
      • Has its fans (Yelp, YouTube?), somewhat similar to Ruby?
      • Less common than Ruby or PHP
  • 3. Java Misconceptions
    • Overly complicated
    • No longer relevant
    • Doesn’t scale as well as PHP
    • Strongly typed is bad/hard vs. Ruby/PHP
    • Takes more code and more time
    • Cannot rapidly prototype
  • 4. Tim Bray - Nov 2006 “Comparing Frameworks”
    • “ For Web apps, I’ve given PHP the edge, because I think building scalable PHP is a little easier . By default, PHP gives you a “shared-nothing” (or at least “shared very little”) architecture, which means you’re going to scale out pretty well until your database hits the wall. Java is a much richer system and assumes you’re smart enough to know whether a shared-nothing architecture is appropriate or not. The effect is, you have to be smarter to get the same kind of scaling out of Java.”
  • 5. Java Realities
    • Very mature and proven
    • Excellent performance (fast JVM/JIT)
    • Scales fine unless you use it wrong (sessions, large heaps)
    • Powerful and flexible
      • Cross-platform
      • Server, client, desktop, mobile, etc.
  • 6. Java Realities
    • Strong typing can actually be a big help (plus JSP/EL handles type conversions and you can also use Object or polymorphism)
    • You can write quick spaghetti code in JSP!
    • JSP is great for rapid prototyping, modified JSPs are automatically recompiled in development
    • J2EE and breadth of Java technologies and frameworks IS complicated!
  • 7. Ruby on Rails vs. Java?
    • Groovy/Grails
    • JRuby
    • Object/relational mapping (Hibernate?)
    • Code by convention (servlet mapping via servlet filter, instead of controller servlet or web.xml?)
  • 8. Who is using Java?
    • Social Networks
    • (Friendster)
    • Bebo
    • Hi5
    • Tagged
    • Tickle
    • Events
    • eVite
    • MeetUp
    • Socializr
    • Involver
  • 9. Who is using Java?
    • E-Commerce
    • Air Canada
    • Bank of America
    • Blue Nile
    • Citysearch
    • DICE
    • DirecTV
    • Fedex
    • Hertz
    • Startups
    • Daily Candy
    • Feedburner
    • Instructables
    • Jaxtr
    • Kaboodle
    • LinkedIn
    • Mint
    • Ning
    • Zillow
    • Hotwire
    • Kayak
    • Kodak/Ofoto
    • Macy's
    • NY Times
    • Shutterfly
    • Snapfish
    • Ticketweb
  • 10. J2EE vs. POJO J2EE The standard for developing multitier enterprise applications POJO Plain Old Java Object
  • 11. Web App Frameworks Struts An open source framework for building Servlet/JSP based web applications based on the Model-View-Controller (MVC) design paradigm WebWorks WebWork is a Java web-application development framework Struts2 Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. Apache Struts 2 was originally known as WebWork 2 Spring Framework Spring is a layered Java/J2EE application framework with a flexible MVC web application framework Maverick Maverick is a Model-View-Controller (aka &quot;Model 2&quot;) framework for web publishing using Java and J2EE. In principle it combines the best features of Struts, WebWork, and Cocoon2
  • 12. More Frameworks JSF JavaServer Faces technology is a framework for building user interfaces for web applications Facelets An alternative view technology for building JSF applications Tapestry Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java Velocity The Apache Velocity Engine is a free open-source templating engine. Velocity permits you to use a simple yet powerful template language to reference objects defined in Java code. Tiles Apache Tiles is a templating framework built to simplify the development of web application user interfaces. Tiles grew in popularity as a component of the popular Struts framework. It has since been extracted from Struts and is now integrated with various frameworks, such as Struts 2 and Shale. Shale Shale is a modern web application framework, fundamentally based on JavaServer Faces
  • 13. Even More Frameworks Seam JBoss Seam is a powerful new application framework for building next generation Web 2.0 applications Helma Helma is an open source web application framework for fast and efficient scripting and serving of your websites and Internet applications. Wicket With proper mark-up/logic separation, a POJO data model, and a refreshing lack of XML, Apache Wicket makes developing web-apps simple and enjoyable again Rife Full-stack open-source component framework to quickly and consistently develop and maintain Java web applications
  • 14. Yet More Frameworks jMaki (GlassFish) jMaki is an Ajax framework that provides a lightweight model for creating JavaScript centric Ajax-enabled web applications using Java, Ruby, PHP, and Phobos XMLC XMLC is a presentation technology that provides an object-oriented mechanism for creating dynamic content from static HTML and XML documents Grails Grails aims to bring the &quot;coding by convention&quot; paradigm to Groovy. It's an open-source web application framework that leverages the Groovy language and complements Java Web GWT Google Web Toolkit (GWT) is an open source Java development framework that lets you escape the matrix of technologies that make writing AJAX applications so difficult and error prone.
  • 15. Object/Relational Mapping
    • Hibernate
    • JDO
    • TopLink (Oracle -> GlassFish)
    • iBatis ( XML-based Object/Relational mapping and persistence framework)
  • 16. Ancient History of Servlets
    • 1999 – HotLinks (social bookmarking)
      • Apache JServ, Solaris, Oracle
      • Servlets writing HTML - ouch
    • 2002 – Friendster
      • JSP 1.0, Tomcat, MySQL
      • Java mixed with HTML
      • Servlets
      • No tag files
  • 17. JSP/Servlets Today
    • 2006 – Socializr
      • JSP 2.0
      • JSTL/EL
      • Tag files written in JSP, SimpleTagSupport, functions, beans
      • Servlets
      • Documentation and support of JSP 2.0/JSTL/tag files poor compared to PHP/ruby/etc.
      • Scriptlets required to access Java constants from JSPs
  • 18. Servlet/JSP Technologies
    • JSP pages
    • JSP fragments
    • EL
    • JSTL
    • .tag files
    • Tag classes
    • functions
    • servlets
    • beans
    • Complicated but powerful/flexible
  • 19. Socializr Java Architecture
  • 20. JSP vs. Servlet? Tag class or function Reusable non-UI code JSP HTML email templates Servlets REST APIs Servlets with ROME RSS feeds Java classes (beans) Data classes and DAOs Tag file Reusable UI component Servlet Logic, modify DB JSP Web page, HTML
  • 21. Hi5 and Bebo Examples
    • Hi5
    • JSP
    • Struts
    • iBatis
    • some Spring libraries
    • Bebo
    • No frameworks
    • JSP
    • Simple in-house MVC
    • Memcached
    • No hibernate
  • 22. Servlet Containers
    • Past
    • Tomcat
    • Jetty
    • Resin
    • Future
    • Tomcat
    • Grizzly (NIO front-end to Glassfish)
  • 23. How to scale a webapp
    • Lightweight non-sticky sessions
    • Cache almost everything (memcached)
    • Decouple slow processes from webapp
    • Segment the database (don’t use replication to scale)
    • Scale out not up (innovate on your app, not your infrastructure)
  • 24. Session Management
    • Use simple lightweight sessions, store in centralized location that can be volatile (memcached at Socializr)
    • 9F6077E3322B4E24C90C43178F42B9C0FFD1E4A43AED1BCA –> 656280029
    • Keep other user data in cache or cookies
    • Avoid sticky sessions, keep load balancing simple
    • Don’t use built-in Servlet/JSP sessions
  • 25. Evite Session Management
  • 26. Caching
    • Use memcached, don’t invent your own
    • Put a large memcached instance on every webapp node
    • Don’t cache inside JVM
    • Cache almost everything but think of your expiration strategy and invalidation rules
  • 27. Performance Tuning
    • JRat -
    • Example: JSTL FormatDate
    • Other cool tools: Lambda Probe, FindBugs
  • 28. Java Technologies
    • Apache commons: DBCP (Connection Pooling), HttpClient, File Upload
    • Connector/J (MySQL JDBC driver)
    • Memcached Java client
    • JMagick (poorly documented) (not JAI)
    • JDOM (for APIs) and StAX (for SolrJ) (XML parsing)
    • ROME (RSS)
    • JavaMail (SMTP and POP)
    • Quartz (scheduling)
    • Apache XML-RPC
    • SolrJ
    • JMS
  • 29. Thank You
    • [email_address]