Thursday, July 28, 2011

Coherence - Security

There are multiple links that provide great example on enabling Security in Coherence:

Secure Oracle Coherence with Kerberos or Active Directory

Coherence Security Examples by Oracle Product Development

Protecting Proxy Servers from Unauthorized Access

I will try to provide step-by-step implementation in future posts covering all the ways in which you can secure Coherence.

Thursday, July 14, 2011

Coherence Web Cache Configuration

Coherence*Web uses the caches and services defined in the session-cache-config.xml file to implement HTTP session management. This file is deployed under WEB-INF/classes in either the instrumented web application or shared WebLogic Coherence*Web SPI library.

Caches

session-management:This cache is used to store internal configuration and management information for the session management implementation. This information is updated infrequently; therefore, it is a replicated cache by default.

servletcontext-storage:If ServletContext attribute clustering is enabled (it is disabled by default), this cache is used to store ServletContext attributes. This cache is replicated by default, as it is expected that there will a few read-mostly attributes.

session-storage:This cache is used to store session models. By default it is mapped to a near cache backed by a distributed cache since it is expected that a container will access and modify a subset of sessions multiple times (assuming that sticky session load balancing is configured.)

session-overflow:If the coherence-sessioncollection-class parameter is set to com.tangosol.coherence.servlet.SplitHttpSessionCollection, this cache will hold "large" session attributes. By default, session attributes larger than 1K will be stored in this cache. This is configured as a distributed cache.

session-death-certificates:Recently expired session IDs are stored in this cache in order to prevent reuse of a recently used session ID. By default, each storage node will hold up to 4000 session IDs, and session IDs will be evicted after 24 hours. This is configured as a distributed cache.

local-session-storage:This local cache is used to store session models that are considered to be "local" by the configured (if any) coherence-distributioncontroller-class.

local-attribute-storage:This local cache is used to store attributes that are not distributed. This can happen under two conditions:
1.A coherence-distributioncontroller-class is configured. Attributes for "local" sessions will be stored in this cache.
2.A non-serializable attribute is set on a distributed session. If coherence-sticky-sessions and coherence-preserve-attributes are set to true, this attribute will be placed in this cache.

Services

ReplicatedSessionsMisc:This replicated service is used by the session-management and servletcontext-storage caches.

DistributedSessions:This distributed service is used by the following caches:
•session-storage
•session-overflow
•session-death-certificates

The tangosol.coherence.session.localstorage system property controls whether or not a JVM will store and manage data for these caches. Under most circumstances, this should be set to false for web container JVMs. See Coherence*Web Deployment Topologies for more details.

SessionOwnership:This invocation service is used by the sticky session optimization feature (if coherence-sticky-sessions is set to true).

Wednesday, July 13, 2011

Setting up Oracle Data Integrator (ODI) with Change Data Capture (CDC)

A detailed article can be found here.

Sizing Oracle Coherence

Rule-of-thumb: each 1 GB JVM can store 350 MB of actual object data

Personal Estimates: 80% of RAM can be used to store Heap (allocated to JVM); assuming no other softwares are running on the machine and make sure there is no active swapping.

Observation:
- In order to make sure that you don't loose GRID data(machine/node-safe), create a minimum cluster of 4 nodes on atleast 2 different machines.
- Best performant with multiple JVMs with memory = Xms = Xmx = 1GB

Examples:

If you would like to store 5GB of data on Coherence Grid, how much server memory and JVM required?

Step 1: 5GB object data would require 5/.35 = 14.28 ~ 15 JVMs with 1 GB memory allocated.
Step 2: It would be ideal to 15 JVMs on 5 machines and each machine running 3 Coherence JVMs
Step 3: Each machine should have RAM = 3/.8 = 3.75 GB (20% used by O/S)

So you would require 5 machines of 4GB to hold 5 GB actual object data. This estimate is on the higher side and can hold much more object data.

Tuesday, July 12, 2011

Where to start learning Coherence?

Coherence Dashboard: Links to everything to do with Coherence

Coherence Reading Material: List of books categorized based on Coherence feature

If you want to start learnig Coherence then, I would recommend to start reading this book.

Coherence Web: Starting seperate Coherence Clusters for multiple applications deployed in the same Weblogic Server

The procedure differs between Weblogic Version 10.3.2 and later. In 10.3.3 and later, the process is well documented and straight-forward due to active-cache integration. But, I could find documentation on Weblogic 10.3.2 and previous versions but the challenge is how run multiple Coherence clusters with different configuration or in Coherence terms, how to put the below mentioned in the Application (EAR/WAR) files:

-session-cache-config.xml
-tangosol-coherence-override.xml

Both the above configuration files should hold the configuration for the cluster and cache topology to be used by this Application. In order to make it possible, create a jar file and include it in the EAR/META_INF/lib folder. This would allow you to override the cache configuration available in the coherence-web-spi and also provide the "tangosol-coherence-override.xml" for Coherence.

The above mentioned steps can also be used when you don't want your EAR/WAR(s) to use the Session objects of other EAR/WAR(s). In this way, you will be able to create multiple clusters with different configuration suited for different applications

Documentation on Coherence Web with Weblogic versions (10.3.3 and higher or 10.3.2 and lower)

There is a tighter integration between Weblogic and Coherence*Web with the introduction of active-cache in Weblogic 10.3.3 and above. In the lower versions of Weblogic, these features and integration with active-cache is not available and documented. You can find the documentation at below links:

Weblogic 10.3.3 and above

Weblogic 10.3.2 and below

Monday, July 11, 2011

Best Practices for Coherence Extend

  • Run Proxy Servers with Local Storage Disabled

  • Do Not Run a Near Cache on a Proxy Server

  • Configure Heap NIO Space to be Equal to the Max Heap Size

  • Set Worker Thread Pool Sizes According to the Needs of the Application - configure a larger number of daemon (worker) threads for the proxy service

  • Be Careful When Making InvocationService Calls

  • Be Careful When Placing Collection Classes in the Cache - Use Collection Interface or wrap them in java objects

  • Run Multiple Proxies Instead of Increasing Thread Pool Size

  • Configure POF Serializers for Cache Servers

  • Use Node Locking Instead of Thread Locking

  • Detailed explaination can be found here.

    Coherence - Logging and Monitoring

    Some of the useful articles on these topics are:

    Logging:

    JMX Reporting:

    Coherence Web versus Application Server HTTP Session Management

    Consider using Coherence*Web if you are encountering any of these situations:
  • your application works with large HTTP session state objects

  • you run into memory constraints, due to storing HTTP session object data

  • you want to off-load HTTP session storage to an existing Coherence cluster

  • you want to share session state across EAR files.
  • Coherence Performance Tuning

    The information is available on the Coherene Dashboard and it is suggested that to achieve maximum performance with Coherence tune your operating environment. Tuning recommendations are available at:

    OS Tuning
    Network Tuning
    JVM Tuning
    Coherence Network Tuning

    Friday, July 8, 2011

    Network Bridge on Windows7/ Vista

    Navigate to Control Panel -> Network and Internet -> Network Connections and select the connections ( press Ctl key) that you want to bridge and click "Add to Bridge".

    The Network bridge can be used to convert Wireless Internet Connection to Wired Connection via Laptop.

    Saturday, July 2, 2011

    How to determine whether a computer is running a 32-bit version or 64-bit version of the Windows operating system

    Here is good article from Microsoft on it:

    http://support.microsoft.com/kb/827218

    Accessing preconfigured Oracle Software Images

    If you want to avoid the hassles of installing the software on your system but play with the software then use the preconfigured images avaiable to download from Oracle Technetwork. These images have preinstalled OS and software but make sure you install the Virtual Box software before opening the images.

    BPEL XPath function to retrieve values from a list

    In BPEL, if you would like to look through a list of XML elements and check certain condition in each element then follow the steps below:

    Sample XML:
    <employees>
    <employee>
    <name>NAME1</name>
    <age>25</age>
    </employee>
    <employee>
    <name>NAME2</name>
    <age>30</age>
    </employee>
    <employee>
    <name>NAME3</name>
    <age>35</age>
    </employee>
    </employees>

    We can use "While" Activity for looping through multiple elements but the real task is to access the data within each dynamically:

    1. Initialize a simple int "counter" variable and set the value = 0

    2. Count the number of employee nodes in employees root node using,
    ora:countNodes("employees/employee")
    [Note: Use BPEL Expression builder to get the XPath Expression but remember to delete bpws:getVariableData from the expression because we are not looking for data but only number of nodes]

    3. Loop through each of the employee node and check if the <age> is greater than 26 as:

    bpws:getVariableData('employees','part',"employee[position()=bpws:getVariableData('counter')]")

    4. Increment the counter and you will be able to a access all the employee data dynamically.

    Things to remember:

    1. In BPEL, the index starts with 1 and not 0 so make sure the "counter" value starts from 1 and not 0.
    2. Whereever in the XPath you are accessing a variable inside a variable such as, { "employee[position()=bpws:getVariableData('counter')]" } use double quotes for outside variable and single quotes for inside variable
    3. Use position() function as shown above

    Search This Blog