Tuesday, May 29, 2012

DynaCache

Coming . soon

I am back  after a short break..
So many things we can discuss here on caching..let me draft the document
Draft v1.0


Dynacache :Advantages/Disadvantages
IBM WebSphere eXtreme Scale -WXS:
EHCache
Jboss cache :
infinispsan cache :
JBOSS DATA GRID (JDG) :

Let us go through  all market leaders ..

But before jumping to any caching.. we should familiar with some caching terminology

such as.. 
Cache id :A unique key to represent any cache object in the cache server
cache expire :Define a time period for any cache to expire 
Cache eviction :If cache is reached it maximum capacity.. apply some rule to remove the some of items to place new items
normally using some algorithm called.. LRU .. etc
invalidation :Invalid the cache id if the data in the cache is not sych with the source system
and..what else.. .

Why wee need caching /Or what time we should think about caching?
- If the cost of any object creation is too heavy 
- if any object is very frequently using/accessing
- if multiple users are using same object 
ya that object/component is eligible for caching.. 

Starting with Dyna cache...

Dyna cache:

This is a in-memory caching mechanism from IBM which is commonly using in the websphere app server
Dynacache is non-transactional and replicated caching system

Dyna cache supports - 
Servlet/JSP object caching, Command level caching.. 
Full page caching
Fragment caching
Data invalidation support
Cache monitoring mechanism
Fine.. that is a 100 feet level view of dynachahe. Let us go in deep

consume-subfragment
do-not-cache
do-not-consume
timeout
Servlet/JSP object caching:  The output of servlet/jsp will be cached against the cacheId

Tuesday, May 15, 2012

A Quick view - ATTRIBUTE DICTIONARY



The Story:
Consider one business scenario where client wants to keep a set of common attributes for all products under a given store.Also this attributes may change frequently and client wants to control the product using same attributes.


Business Solution:
WCS provides a feature to keep set of common attributes that can be reused by multiple products- called as Attribute Dictionary

The Features:
-Control the product searchable ,comparable and displayable feature by changing the value in ATTR table
-Reduced data loading because attributes is saved in only one location
-Easy to manage the attributes
-Single Attribute dictionary is allowed for a given store. Under each Attribute dictionary you can upload any number of attributes
-Use the massload utility to upload to attribute dictionary


Data Model

ATTRDICGRP(attribute dictionary group)               -Define a attribute dictionary group
ATTRTYPE(attribute type)                                      -Define attribute type
ATTRDICTGRPATTRREL(attrdictgrp_id,attr_id)   -relation table for group and attribute
ATTRDICT(Attribute Dictionary- only one for given store)      -Dictionary - only one for given store
ATTR(attribute dictionary attributes-attr_id,attrtype_id,attrdict_id)   -Define any number of attributes
ATTRDESC                       -About the attribute
ATTRVALDESC(attrvalid)                             -Language sensitive attribute value description.)
CATENTRYATTR(catentry_id,attrid,attrvalid) -Relation table catentry-attribute and attrvalue

+ Feature pack 4 has this feature                            

Wednesday, May 9, 2012

OAuth Implementation in WCS

What is OAuth?
OAuth is an open standard for authorization. It allows users to share their private resources
(e.g. photos, videos, contact lists) stored on one site with another site without having to hand out their credentials,
typically supplying username and password tokens instead. Each token grants access to a specific site
(e.g., a video editing site) for specific resources (e.g., just videos from a specific album) and for a defined duration (e.g., the next 2 hours).
This allows a user to grant a third party site access to their information stored with another service provider,
without sharing their access permissions or the full extent of their data.
Ref: http://en.wikipedia.org/wiki/OAuth

Why OAuth?
The OAuth protocol allows third-party applications to identify and authenticate themselves with a content provider.

Sample business scenarions?
1)You have purchased a product from Walmart online .and adding comments there
These comments will can be shared in the Facebook/twitter.

2)You have placed an online order for eBook "The Da Vinci Code" .You need this ebook on Your eReader application
Here the fullfillment details will be send to the concerned vendor and vendor will do order fullfillment for you

3)
You have added some game application on your Facebook
The game app will ask you to share some public informtion from Facebook



Advantages:?
High Business demands.
Share only the subset of the data with third-party applications
The end user has total control over the data
Secured data is not shared across third-party applications .
Limited access to secured data.
High securiy.
Very suitable on Web based application
Highly demanding the social commerce
No need to share the Username and password to third-party applications
etc etc


Overview?
There are manly 3 actors in this game

1.User- The end user (That is you :))
2.Vendor- Service Provider .Who actually holds your secure data such us credit card,personal info, photos etc.(eg: facebook)
3 Client- Consumer.Any Third party applications such as ecoomerce site, game applications etc


Game Rules
1. User  purchased items from the client(Third party applications)
2. User wants to use the data which is stored in the Vendor  side
3. CLient sends request to the Vendor to provde the secure data(limited access)

NB: Here user should register in both Client side and Vendor side

Action : 
User logged into Client side and make a link to the Vendor site
Vendor will do the authentcaion of the user and ask permission to the user to provide the temporary key to the client

User approves the permission(Client Authorization )

Vendor send a temporary key(life time is 10-20 mins) to Client

Client receives the temporary key and request a permanant key to the vendor with Client secret

Vendor validate the temporary key, client secreat then provide valid key with limited accees to the Client(valat key)

Client receives this valet key and saved in client location(DB,LDAP, etc)

CLient make a link with vendor and request for information(limited)

There will be mechanism to revoke the valet key as per the neeed





.