Thursday 20 August 2015

Application Architecture Types

The following are the common basic types of applications that you may decide to build:

  • Mobile applications. Applications of this type can be developed as thin client or rich client applications. Rich client mobile applications can support disconnected or occasionally connected scenarios. Web or thin client applications support connected scenarios only. Device resources may prove to be a constraint when designing mobile applications.
  • Rich client applications. Applications of this type are usually developed as stand-alone applications with a graphical user interface that displays data using a range of controls. Rich client applications can be designed for disconnected and occasionally connected scenarios if they need to access remote data or functionality.
  • Rich Internet applications. Applications of this type can be developed to support multiple platforms and multiple browsers, displaying rich media or graphical content. Rich Internet applications run in a browser sandbox that restricts access to some features of the client.
  • Service applications. Services expose shared business functionality and allow clients to access them from a local or a remote system. Service operations are called using messages, based on XML schemas, passed over a transport channel. The goal of this type of application is to achieve loose coupling between the client and the server.
  • Web applications. Applications of this type typically support connected scenarios and can support different browsers running on a range of operating systems and platforms.
There are many other more specific types of application that you can design and build. In general, these types are specializations or combinations of the basic types described in this list.

Application Type Considerations

The following table indicates the benefits and considerations for the common application archetypes.
Application type
Benefits
Considerations
Mobile applications
Support for handheld devices.
Availability and ease of use for out of office users.
Support for offline and occasionally-connected scenarios.
Input and navigation limitations.
Limited screen display area.
Rich client applications
Ability to leverage client resources.
Better responsiveness, rich UI functionality, and improved user experience.
Highly dynamic and responsive interaction.
Support for offline and occasionally connected scenarios.
Deployment complexity; however, a range of installation options such as ClickOnce, Windows Installer, and XCOPY are available.
Challenging to version over time.
Platform specific.
Rich Internet applications (RIA)
The same rich user interface capability as rich clients.
Support for rich and streaming media and graphical display.
Simple deployment with the same distribution capabilities (reach) as Web clients.
Simple upgrade and version updating.
Cross-platform and cross-browser support.
Larger application footprint on the client compared to a Web application.
Restrictions on leveraging client resources compared to a rich client application.
Requires deployment of a suitable runtime framework on the client.
Service applications
Loosely coupled interactions between client and server.
Can be consumed by different and unrelated applications.
Support for interoperability.
No UI support.
Dependent on network connectivity.
Web applications
Broad reach and a standards-based UI across multiple platforms.
Ease of deployment and change management.
Dependent on continual network connectivity.
Difficult to provide a rich user interface.


Each application type can be implemented using one or more technologies. Scenarios and technology constraints, as well as the capabilities and experience of your development team, will drive your choice of technology.
The following sections describe each of the application types in more detail:
  • Mobile Application Archetype
  • Rich Client Application Archetype
  • Rich Internet Application Archetype
  • Service Archetype
  • Web Application Archetype
This guide also contains details of some of the more specialized application types. For more information, see the following:
  • Chapter 26 "Designing Hosted and Cloud Services"
  • Chapter 27 "Designing Office Business Applications"
  • Chapter 28 "Designing SharePoint LOB Applications"

Mobile Application Archetype

A mobile application will normally be structured as a multilayered application consisting of user experience (presentation), business, and data layers, as shown in Figure 1.
Ee658104.c8a7050b-d48b-4fe8-b3de-c59e6b3b742e(en-us,PandP.10).png
Figure 1 
The typical structure of a mobile application
When developing a mobile application, you may choose to develop a thin Web-based client or a rich client. If you are building a rich client, the business and data layers are likely to be on the device itself. If you are building a thin client, the business and data layers will be on the server. Mobile applications commonly make use of locally cached data to support offline or disconnected operation, and synchronize this data when connected. They may also consume services exposed by other applications, including S+S hosted services and Web services. Data source synchronization and other services are often exposed in a controlled way to a mobile client application through a specific server-based infrastructure.
Consider using mobile applications if:
  • Your users depend on handheld devices.
  • Your application supports a simple UI that is suitable for use on small screens.
  • Your application must support offline or occasionally connected scenarios. In this case, a mobile rich client application is usually the most appropriate.
  • Your application must be device independent and can depend on network connectivity. In this case, a mobile Web application is usually the most appropriate.
To learn how to design a mobile application, see Chapter 24, "Designing Mobile Applications."

Rich Client Application Archetype

Rich client user interfaces can provide a highly responsive, interactive, and rich user experience for applications that must operate in stand-alone, connected, occasionally connected, and disconnected scenarios. A rich client application will normally be structured as a multilayered application consisting of user experience (presentation), business, and data layers, as shown in the Figure 2.
Ee658104.a0583784-5eab-405b-8cd9-4ce01d55df4b(en-us,PandP.10).png
Figure 2 
The typical structure of a rich client application
A rich client application may use data stored on a remote server, data stored locally, or a combination of both. It may also consume services exposed by other applications, including S+S hosted services and Web services.
Consider using rich client applications if:
  • Your application must support disconnected or occasionally connected scenarios.
  • Your application will be deployed on client PCs.
  • Your application must be highly interactive and responsive.
  • Your application UI must provide rich functionality and user interaction but does not require the advanced graphics or media capabilities of a RIA.
  • Your application must utilize the resources of the client PC.
To learn how to design a rich client application, see Chapter 22 "Designing Rich Client Applications."

Rich Internet Application Archetype

A rich Internet application (RIA) runs in the browser in a sandbox. The benefits of a RIA over traditional Web applications include richer user experience, improved user responsiveness, and improved network efficiency. A RIA will normally be structured as a multilayered application consisting of user experience (presentation), service, business, and data layers, as shown in Figure 3.
Ee658104.e3fd41d1-312f-4cc5-8685-2154a49e5fbc(en-us,PandP.10).png
Figure 3 
The typical structure of a rich Internet application
RIAs generally depend on a client-side plug-in or hosted execution environment (such as a XAML runtime or Silverlight). This plug-in communicates with remote Web server hosts that generate the code and data consumed by the client plug-in or execution environment.
Consider using rich Internet applications if:
  • Your application must support rich media and provide a highly graphical display.
  • Your application must provide a rich, interactive, and responsive UI compared to Web applications.
  • Your application will leverage client-side processing in a restricted manner.
  • Your application will utilize client-side resources in a restricted manner.
  • You want the simplicity of a Web-based deployment model.
To learn how to design a rich Internet application, see Chapter 23, "Designing Rich Internet Applications."

Service Archetype

In the context of this guide, a service is a public interface that provides access to a unit of functionality. Services literally provide some programmatic service to the caller that consumes the service. A service application that exposes such services will normally be structured as a multilayered application consisting of service, business, and data layers, as shown in Figure 4.
Ee658104.6a8b0a49-eba5-4fd2-bc7c-190856b0e3e7(en-us,PandP.10).png
Figure 4 
The typical structure of a service application
Services are loosely coupled, and can be combined to provide functionality that is more complex. Services are distributable, and can be accessed from a remote machine as well as from the machine on which the service is running. Services are also message oriented. This means that the interfaces are defined by a Web Services Description Language (WSDL) document and operations are called using messages based on XML schemas, which are passed over a transport channel. In addition, services support a heterogeneous environment by focusing interoperability on the message/interface definition. If components can understand the message and interface definition, they can use the service regardless of their base technology.
Consider using service applications if:
  • Your application will expose functionality that does not require a UI.
  • Your application must be loosely coupled with its clients.
  • Your application must be shared with or consumed by other external applications.
  • Your application must expose functionality that will be consumed by applications over the Internet, an intranet, or on the local machine.
To learn how to design services and service applications, see Chapter 25 "Designing Service Applications."

Web Application Archetype

The core of a Web application is its server-side logic. This logic may be comprised of many distinct layers. A typical example is a three-layered architecture comprising presentation, business, and data layers, as shown in Figure 5.
Ee658104.83ae5a18-d230-4569-aac0-82ce5e30ea61(en-us,PandP.10).png
Figure 5 
The typical structure of a Web application

A Web application will normally access data stored on a remote database server. It may also consume services exposed by other applications, including S+S hosted services and Web services.

Reading AWR Reports (Basic Approach)

If you are new to the AWR reports, the first thing you should probably do is run the ADDM report for the specific time period. The ADDM report provides root cause analysis of the parts of the system consuming the most time. It is often quicker to start with the ADDM report to help narrow down your area of focus in the AWR report.

When looking at an AWR report, a good place to start is the "Top 5 Timed Foreground Events" section, near the top of the report. This gives you an indication of the bottlenecks in the system during this sample period.

Once you've identified the top events, drill down to see what SQL and PL/SQL are consuming the majority of those resources. On the "Main Report" section, click the "SQL Statistics" link.

On the "SQL Statistics" section, click the "SQL ordered by ??" link that most closely relates to the wait event you identified in the "Top 5 Timed Foreground Events" section. In this case, the "DB CPU" was the top event, so it would seem sensible to try the "SQL ordered by CPU Time" link first.

You are then presented with the SQL and PL/SQL that are using most of the specified resource during the sample period. You can then attempt to tune these areas to reduce the impact.

AWR(Automatic Workload Repository) & It's Features

The AWR is used to collect performance statistics including:
  • Wait events used to identify performance problems.
  • Time model statistics indicating the amount of DB time associated with a process from the V$SESS_TIME_MODEL and V$SYS_TIME_MODEL views.
  • Active Session History (ASH) statistics from the V$ACTIVE_SESSION_HISTORY view.
  • Some system and session statistics from the V$SYSSTAT and V$SESSTAT views.
  • Object usage statistics.
  • Resource intensive SQL statements.

How to read AWR report?

This section contains detailed guidance for evaluating each section of an AWR report.  

Report Summary: This gives an overall summary of the instance during the snapshot period, and it contains important aggregate summary information.

Cache Sizes (end): This shows the size of each SGA region after AMM has changed them.  This information can be compared to the original init.oraparameters at the end of the AWR report.

Load Profile: This important section shows important rates expressed in units of per second and transactions per second.

Instance Efficiency Percentages: With a target of 100%, these are high-level ratios for activity in the SGA.

Shared Pool Statistics: This is a good summary of changes to the shared pool during the snapshot period.

Top 5 Timed Events: This is the most important section in the AWR report.  It shows the top wait events and can quickly show the overall database bottleneck.

Wait Events Statistics Section: This section shows a breakdown of the main wait events in the database including foreground and background database wait events as well as time model, operating system, service, and wait classes statistics.

Wait Events: This AWR report section provides more detailed wait event information for foreground user processes which includes Top 5 wait events and many other wait events that occurred during the snapshot interval.

Background Wait Events: This section is relevant to the background process wait events.

Time Model Statistics: Time mode statistics report how database-processing time is spent. This section contains detailed timing information on particular components participating in database processing.

Operating System Statistics: The stress on the Oracle server is important, and this section shows the main external resources including I/O, CPU, memory, and network usage.

Service Statistics: The service statistics section gives information about how particular services configured in the database are operating.

SQL Section: This section displays top SQL, ordered by important SQL execution metrics.
          SQL Ordered by Elapsed Time: Includes SQL statements that took significant execution time during processing.
          SQL Ordered by CPU Time: Includes SQL statements that consumed significant CPU time during its processing.
          SQL Ordered by Gets: These SQLs performed a high number of logical reads while retrieving data.
          SQL Ordered by Reads: These SQLs performed a high number of physical disk reads while retrieving data.
          SQL Ordered by Parse Calls: These SQLs experienced a high number of reparsing operations.
          SQL Ordered by Sharable Memory: Includes SQL statements cursors which consumed a large amount of SGA shared pool memory.
          SQL Ordered by Version Count: These SQLs have a large number of versions in shared pool for some reason.

Instance Activity Stats: This section contains statistical information describing how the database operated during the snapshot period.
          Instance Activity Stats (Absolute Values): This section contains statistics that have absolute values not derived from end and start snapshots.
          Instance Activity Stats (Thread Activity): This report section reports a log switch activity statistic.

I/O SectionThis section shows the all important I/O activity for the instance and shows I/O activity by tablespace, data file, and includes buffer pool statistics.
          Tablespace IO Stats 
          File IO Stats 
          Buffer Pool Statistics 

Advisory SectionThis section show details of the advisories for the buffer, shared pool, PGA and Java pool.
          Buffer Pool Advisory 
          PGA Aggr Summary: PGA Aggr Target Stats; PGA Aggr Target Histogram; and PGA Memory Advisory. 
          Shared Pool Advisory 
          Java Pool Advisory 

Buffer Wait Statistics: This important section shows buffer cache waits statistics.

Enqueue Activity: This important section shows how enqueue operates in the database. Enqueues are special internal structures which provide concurrent access to various database resources.
Undo Segment Summary: This section gives a summary about how undo segments are used by the database.

Undo Segment Stats: This section shows detailed history information about undo segment activity.

Latch Activity: This section shows details about latch statistics. Latches are a lightweight serialization mechanism that is used to single-thread access to internal Oracle structures.
          Latch Sleep Breakdown
          Latch Miss Sources
          Parent Latch Statistics
          Child Latch Statistics

Segment Section: This report section provides details about hot segments using the following criteria:
          Segments by Logical Reads: Includes top segments which experienced high number of logical reads.
          Segments by Physical Reads: Includes top segments which experienced high number of disk physical reads.
          Segments by Buffer Busy Waits: These segments have the largest number of buffer waits caused by their data blocks.
          Segments by Row Lock Waits: Includes segments that had a large number of row locks on their data.
          Segments by ITL Waits: Includes segments that had a large contention for Interested Transaction List (ITL). The contention for ITL can be reduced by increasing INITRANS storage parameter of the table.

Dictionary Cache Stats: This section exposes details about how the data dictionary cache is operating.

Library Cache Activity: Includes library cache statistics describing how shared library objects are managed by Oracle.

SGA Memory Summary: This section provides summary information about various SGA regions.


init.ora ParametersThis section shows the original init.ora  parameters for the instance during the snapshot period.

Friday 14 August 2015

Performance Monitoring

Application Performance Monitoring (APM) allows you to detect application performance issues – before your customer does. Application Performance Monitoring ensures Web application performance meets your customer's expectations and consistently delivers their business SLA.

Performance Engineering

Performance engineering or SPE (Systems Performance Engineering or Software Performance Engineering) within systems engineering, encompasses the set of roles, skills, activities, practices, tools, and deliverable applied at every phase of the systems development life cycle which ensures that a solution will be designed, implemented, and operationally supported to meet the non-functional requirements for performance (such as throughput, latency, or memory usage).
It may be alternatively referred to as software performance engineering or application performance engineering within software engineering. As the connection between application success and business success continues to gain recognition, particularly in the mobile space, application performance engineering has taken on a preventative and perfective role within the software development life cycle. As such, the term is typically used to describe the processes, people and technologies required to effectively test non-functional requirements, ensure adherence to service levels and optimize application performance prior to deployment.
The term performance engineering encompasses more than just the software and supporting infrastructure, and as such the term performance engineering is preferable from a macro view. Adherence to the non-functional requirements is also validated post-deployment by monitoring the production systems. This is part of IT service management.
Performance engineering has become a separate discipline at a number of large corporations, with tasking separate but parallel to Systems Engineering. It is pervasive, involving people from multiple organizational units; but predominantly within the information technology organization.

Thursday 13 August 2015

Why Performance Testing is Required?

The goal of performance testing is to appraise any user experience in realistic scenarios on your target application. It will allow you to assess machine and infrastructure capability. 
Performance testing, load testing, stress testing, capacity testing are all based on business requirements. It’s a professional approach to evaluating the performance of an application. It requires the simulation of real load scenarios running against your target applications or websites. So that means concurrent users.