Web 2.0 Development with IBM DB2

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Web 2.0 Development with IBM DB2 - Presentation Transcript

    1. 0
      Web 2.0 Development with DB2
      Dr. Vladimir Bacvanski, Vice President, InferData, vladimir@inferdata.com
      Rafael Coss, Solutions Architect, IBM, rcoss@ibm.com
      Session Number 2166
    2. Outline
      Challenges of Enterprise Web 2.0 Systems
      Some Side-Effects of O/R Mapping
      Data-Driven Applications and pureQuery
      Rich Internet Applications: Ajax and Dojo with RAD
      pureQuery + JEE Applications with RAD
      pureQuery + Situational Applications with WebSphere sMash
      IBM Optim Development Studio
      Integrating pureQuery and WebSphere sMash with RAD
    3. 2
      Show of Hands!
      How many are developers, managers,involved with databases, others?
      Are you using Java, Ruby, Python, Groovy, PHP,?
      How many are using EJB, plain JDBC, Hibernate?
      What’s most important?
      Productivity
      Reuse
      Availability
      Performance
      Shared Database
      Flexibility
    4. COMMUNITYParticipation
      RICHUser Interfaces
      Software as aSERVICE
      Web 2.0
      DATA
    5. What matters most to Enterprise Web 2.0 Systems?
      MVC architecture?
      Java vs. Python vs. [insert your favorite language]?
      Ajax vs. Flash?
      MASSIVE
      AMOUNTS
      OF DATA
    6. Java Data Access – Two Views of the World
      Writing Java code is so easy with this eclipse environment.I wish it was that easy to get the SQL right.
      JSP
      QoS goals
      Spring
      Another runaway query! Where are these coming from? JDBC? Hmmm…
      Runstats
      XML
      http
      Partition strategy
      Stored
      Procedures
      mashup
      SQL
      Response Time!
      REORG
      JSON
      JDBC
      This ORM doesn’t allow me to leverage all my database’s SQL.
      Inconsistent response time? How long will it take me to find the offending application sending bad SQL this time?
      JDBC
      I can’t believe I got called out last week. I wish I could see how these queries will run in production.
      SQLJ
      JPA
      These ad-hoc queries are dangerous. We need a library of tested SQL interfaces.
      Application
      Developer
      Database Developer& Administrator
      Spring
      Why does this query take so long?
      iBatis, . . .
      Sometimes I need POJOs, sometime JSON, sometimes XML, what should I use?
      Static SQL? Sounds like another delay to getting my program deployed
      Another GRANT request? This security administration is out of control.
      Can I examine the SQL “before” the application is deployed?
    7. Meet in the
      Middle
      Data Mapping Approaches
      Application-Centric
      Top-Down
      Start with Object Domain Model
      ORM Mapping
      Well supported in dynamic languages and frameworks
      Hybrid
      Meet in the middle
      Can be challenging w/o comprising
      Data-Centric
      Bottom-UP
      Start with Relational Data Model
      Not well supported in dynamic languages and frameworks
      Top
      Down
      Persistence Layer
      Bottom
      Up
      6
    8. EJB and Hibernate Side Effects
      • DBA and SQL developer Amnesia
      • Where is the SQL coming from?
      • What is it?
      • Where is it?
      • How do we tune it?
      • How de we manage it?
      • Performance Concerns:
      • Some App Server vendors claim (unsurprisingly) that Managed objects performs fine.
      • There are many user claims of bad Managed object performance is bad on the web.
      • As always, the truth is in the middle.
      • And will depend on your app server, application, database, etc ..
      “Our top story: Large Customer moves from COBOL to Java to become more agile. In other news, DBA develop amnesia.”
      7
      7
    9. A high-performance, data access platform to simplify developing, managing, securing, and optimizing data access.
      Introducing pureQuery
      pureQuery Components:
      Simple and intuitive API
      Enables SQL access to databases or in-memory Java objects
      Facilitates best practices
      Optim Development Studio (integrates with RAD)
      Integrated development environment with Java and SQL support
      Improve problem isolation and impact analysis
      Optim pureQuery Runtime
      Flexible static SQL deployment for DB2
    10. Design Phase pureQuery close-up
      Model Integration
      • Generate Object Model and code from Data Model
      V2.2
      Jump Start Application Design
      • Generate SQL and Code from Database Objects
      • Setup basic DAO Pattern
      Existing JDBC to Static
      • Reroute Dynamic Queries to Static
      Code Development Productivity
      • Code Generation, Content Assist
      • Database aware, Java SQL Editor
      SQL Replacement
      • Replace Query w/o changing source
      SQL Performance Metrics
      • Find and sort query elapsed time from Java
      Java to SQL Integration
      • Categorize by Java, SQL, Database , Packages, track back to line of code
      Problem Determination
      • Monitor WebSphere Connection Pool, JDBC Driver, Network
      • Track back to SQL and line of code in the application
      Static SQL
      • Lock in Access plans, Improve Security, Consistent Performance
      SQL Injection Prevention
      • Lock down SQL for Dynamic
    11. Code Example: JDBC
      java.sql.PreparedStatementps = con.prepareStatement(
      "SELECT NAME, ADDRESS,PHONE_NUM FROM EMP
      WHERE NAME=?");
      ps.setString(1, name);
      java.sql.ResultSetrs= ps.executeQuery();
      names.next();
      Employee myEmp = new Employee();
      myEmp.setName(rs.getString(1));
      myEmp.setHomeAddress(rs.getString(2));
      myEmp.setHomePhone(rs.getString(3));
      names.close();
      class Employee {
      String name;
      String homeAddress;
      String homePhone;

      }
    12. Code Example: pureQuery
      11
      Employee myEmp= db.queryFirst( "SELECT NAME, ADDRESS, PHONE_NUM FROM EMP WHERE NAME=?", Employee.class, name);
      Even simpler, if we have a method getEmployee with a Java annotation or XML file with SQL for the query:
      Employee myEmp= getEmployee(name);
    13. Design
      Develop
      Optimize
      Govern
      Models
      Policies
      Metadata
      Deploy
      Operate
      IBM Optim pureQuery
      Reduce costs
      Increase system throughput
      Improve developer productivity
      Move workload to zIIP and zAAP
      Improve quality of service for new and existing Java applications
      Improve performance
      Lock in access plans
      Speed up problem resolution
      Reduce development time for new Java applications
      Bridge Java and data
      Balance productivity and control
      Enhance developer and DBA collaboration
      Enhance security
      Limit user access
      Minimize SQL injection risk
      Improve audit readiness
      Developer
      Develop
      Code
      Debug
      Test
      Tune, Package
      Tester
    14. Why should DBAs care ?
      DBAs have little to no visibility of application SQL before deployment, no opportunity for review and optimization
      Problem isolation takes days with contemporary environments such as Java, PHP, .NET, etc due to inability to trace SQL to Java application and source code
      Constantly increasing Java application workload taxes existing systems – need to fit more work into existing systems
      SQL injection represents an increasing risk to data security
    15. Why should Developers care ?
      Get data access right the first time !
      Get it done faster - Improved productivity
      Single environment that spans Java application and database development
      Improved problem isolation and resolution
    16. How well does it work? – Java applications
      In-house testing shows significant performance improvements
      IRWW – an OLTP workload, Type 4 driver
      Cache hit ratio between 70 and 85%
      23 % improvement in throughput using pureQuery over dynamic JDBC
      15% - 25% reduction on CPU per transaction over dynamic JDBC
      15
    17. How well does it work? - .Net applications
      Throughput during static execution increased by 159% over dynamic SQL execution assuming a 79% statement cache hit ratio
      • IRWW – OLTP application
      • Application accesses DB2 for z/OS
      *Any performance data contained in this document were determined in various controlled laboratory environments and are for reference purposes only. Customers should not adapt these performance numbers to their own environments as system performance standards. The results that may be obtained in other operating environments may vary significantly. Users of this document should verify the applicable data for their specific environment.
      16
    18. 17
      Control performance
      Decide at deployment time how the SQL is executed
      Understand and lock down the access plan for SQL
      Replace suboptimal SQL without changing the application
      Control security
      Prevent SQL injection
      Prevent execution of unauthorized SQL
      Better manage database security
      See inside applications that are driving your database
      Understand where SQL comes from
      Understand when frameworks and ORM’s are getting in the way
      Simplify problem determination and troubleshooting
      Correlate problem SQL with applications, ORM’s and frameworks
      Optim pureQuery Runtime
    19. 18
      How do I start with pureQuery
      Existing applications
      Optimize existing JDBC (and .NET!) applications
      No code changes needed
      Have to go through the client optimization process to get to static SQL
      New applications
      Use the pureQuery API
      Development codes using one API regardless of whether it is deployed dynamically or statically
      DBA deploys statically
      No need to go through client optimization process
      Other
      JPA, iBatis, Hibernate
    20. 19
      pureQuery Gives You Options
      V2.1 Feature
      Data Web Services, Project Zero, sMash
      .Net applications
      Hibernate, iBATIS, EclipseLink,...
      JPA for WebSphere, Apache OpenJPA
      Optim pureQuery
      Plain JDBC
      JPA API
      Web API
      Open Source Persistence API
      .Net Applications
      pureQuery API
      JDBC API
      JPA Persistence Engine
      Open Source Persistence Engine
      JDBC
      pureQuery
      ADO .Net
      JCC driver
      DB2 and Informix now
      More coming
    21. 20
      pureQuery Facilitates Best Practices
      Supports both inline SQL and Java annotations (method)
      Intuitive interfaces for common data retrieval and manipulation scenarios hides JDBC complexity
      Query First
      Homogeneous Batch
      Reduce network trips to the database
      Query Over Java Collections
      Heterogeneous Batch
      Use custom result handlers to map results to POJO’s, XML, JSON, …
      Write high performance Java data access applications, Part 3:
      Data Studio pureQuery API best practices
      -- VitorRodrigues
      http://www.ibm.com/developerworks/db2/library/techarticle/dm-808rodrigues/?S_TACT=105AGX01&S_CMP=LP
    22. 21
      Optimize Existing JDBC Applications
      Improve performance for DB2 – without changing a line of code
      Capture Configure Bind Execute
      pureQuery client optimization enables static execution for JDBC applications (custom-developed, framework-based, or packaged)
      Existing JDBC Application
      Captured SQL-
      related
      metadata
      JDBC Driver w/ pureQuery
      Dynamic SQL execution
      Static SQL execution
      DB2 Data Servers
      "The ability to use static SQL with pureQuery is huge. Recently, I worked with a client who could reduce CPU usage by 7 percent thanks to this one feature."
      — David Beulke, Pragmatic Solutions Inc.
    23. Business Analyst
      RequirementsAnalyst
      Data Architect
      Data Access Developer
      Database Administrator
      Software Architect
      Developer
      Integration with Rational
      Creates businessprocess model
      WebSphereBusiness Modeler
      Transform between business items and data model
      Create & manage software delivery requirements
      Link requirements to data assets
      RationalRequisitePro
      Create architectural model enablingthe tasks from BPM to be
      automated
      RationalSoftware Modeler 7.5
      Transform between software and data models
      Create or reverse engineer logical and physical models
      Transform Models to Code
      RationalSoftware Architect 7.5
      Infosphere
      Data Architect 7.5
      Implement new& integrate existing services
      Implement newprocedures and services
      RationalApplication Developer7. 5
      Optim Development Studio
      Extract test data from production systems
      Rational
      ClearQuest
      Optim Test Data Manager
    24. Add basic OR mapping and annotated-method style
      pureQuery
      pureQuery Balances Productivity and Control
      Managed objects
      Object-relational mapping
      Full SQL control
      Code all your SQL
      JDBC / SQLJ
      Use SQL templates, inline only
      Spring
      templates
      iBATIS
      Complex OR mapping and persistence management, but loss of controls
      Hibernate
      Adds container management option
      OpenJPA
      (EJB3)
    25. RAD / Development Studio Data Centric Development Scenario
      Write in JavaUsing RAD+WAS FP for Web 2.0
      Write in Java with pureQueryUsing Optim Dev. Studio in RAD
      Access generated Java data objects from code developed in RAD
      WAS Feature Pack for Web 2.0
    26. RAD and Web 2.0 Rich Internet Applications
      RAD supports development of Ajax applications
      Essentially: HTML + JavaScript + Asynchronous communication
      Uses Dojo Ajax libraries
      IBM Dojo extensions
      Visual tools for Dojo UI development
      Libraries and tools:
      Invoking Java code from Dojo with RPC Adapter
      JSON4J
      Ajax messaging
      25
    27. Choosing the Right Tools
      Strategic, IT built applications.
      WebSphere sMash
      Responding to unplanned situations.
      Innovating around prospective business opportunities where agility is key and the outcome is still unknown.
      Enabling new insights by combining information from the web and enterprise data sources.
      RAD + WASHeavily used, complex applications built by IT teams.
      Usage
      Simple applications built by professionals
    28. What is WebSphere sMash?
      Groovy and PHP
      Uses pureQuery for data access
      Can use Java code
      Convention over configuration
      Common tasks do not require configuration
      Application-centric runtime
      Write the app, run it, and it’s ready for use
      No need for a separate application server
      Each app has its own JVM process
      Fast start!
      27
      A complete platform for developing, assembling
      and executing agile Web 2.0 apps quickly and simply.
    29. RAD, WebSphere sMash and pureQuery in Data Centric Development
      Development scenario:
      A database already exist
      We want to use the productive Optim Development Studio development features
      We want to benefit from pureQuery features
      We may need to integrate with other already existing components and applications
      Solution:
      Use WebSphere sMash together with RAD + Development Studio
      Shell share
      Generate Java code from Development Studio functionality, use from Groovy
      Use RAD powerful features for GUI Dojo development and integration with other components and applications
    30. Development and Execution: pureQuery and sMash
      Develop mostly w. Optim Dev. Studio + sMash
      Develop mostly with RAD
      RIA UI with Dojo
      Design
      DB
      JEE/J2EEComponents
      Existing Applications
      Execution
    31. Start with the Database
      Use Development Studio to explore the database
      • Then generate the pureQuery code
      • This will create the Java classes in the sMash project
    32. Using pureQuery Code in WebSphere sMash
      Using Development Studio, pureQuery code is generated in Java folders
      pureQuery code is used from Groovy or PHP
    33. Using Java pureQuery Code from Groovy
      • Access the database using the pureQuery generated helper class
      • Invoke generated method to list the employees
      • Convert the result to JSON and send it to the client
      • Clients consume the result as e.g. RIA: AJAX, Flex, …
      • sMash function handles GET HTTP requests
    34. 33
    35. Conclusion
    36. Demo
      35
      Demo!
    37. Next Steps – Learn and Explore!
      • Optim Development Studio and pureQuery
      • http://ibm.com/software/data/optim/development-studio/
      • WebShpere sMash
      • http://ibm.com/software/webservers/smash/
      • Rational Application Developer
      • http://ibm.com/software/awdtools/developer/application/
    38. Where to go Next? Resources and more…
      WebSphere sMash
      http://www.ibm.com/websphere/smash
      Optim Development Studio
      http://www.ibm.com/software/data/optim/development-studio/
      IBM pureQuery
      http://www.ibm.com/software/data/optim/purequery-platform/faq.html
      pureQuery Custom Training
      InferData, IBM Business Partner http://www.inferdata.com
      Course: Developing Database Applications with Optim Development Studio and pureQuery
      http://www.inferdata.com/training/data/optim_purequery_training.html
      37
    39. Web, Blogs
      Project Zero
      http://www.projectzero.org
      Integrated Data Management (Optim and Data Studio)
      http://www.ibm.com/developerworks/spaces/optim
      Blogs:
      On Building Software http://www.OnBuildingSoftware.com
      Data Life Cycle ++ http://datalifecycle.blogspot.com
      Twitter:
      http://twitter.com/OnSoftware
      http://twitter.com/racoss
      38
    40. 39
      Thank You!Your Feedback is Important to Us
      Please complete the survey for this session by:
      Accessing the SmartSite on your smart phone or computer at: iodsmartsite.com
      Surveys / My Session Evaluations
      Visiting any onsite event kiosk
      Surveys / My Session Evaluations
      Each completed survey increases your chance to win an Apple iPod Touch with daily drawling sponsored by Alliance Tech
      39

    + Dr. Vladimir BacvanskiDr. Vladimir Bacvanski, 4 weeks ago

    custom

    147 views, 0 favs, 1 embeds more stats

    Vladimir Bacvanski and Rafael Coss

    Common demands more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 147
      • 141 on SlideShare
      • 6 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 7
    Most viewed embeds
    • 6 views on http://www.onbuildingsoftware.com

    more

    All embeds
    • 6 views on http://www.onbuildingsoftware.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories