reactive data system
DESCRIPTION
Reactive Data System is a framework which is highly responsive to change in state of data. This can be used in developing data-intensive enterprise application. Consider an example of e-retail whenever a consumer place an order it need to be notified to multiple department namely shipping, warehouse, finance, etc. Normally this is achieved with the help of call stack mechanism, developer has to call each action or a function explicitly evertime order is placed or a payment is done, as this is executed synchronously one after another leading to high coupling and directly effect the response time leading to bad user experience. Using RDS, developer can separate such action which can be carried out independently making loose coupling among components of user app. It works on principle of Event driven architecture. One may think why to worry about RDS when same thing can be achieved with the help of triggers. But triggers in sql has many limitation such as max number of triggers on a table, no user defined function can be called when though triggers, no multiple database support. All this limitations are overcomes through our RDS. RDS provide GUI and API for Developer to register events and actions. There can be N action on 1 events. Along with data driven events we are supporting time driven events.TRANSCRIPT
Reactive Data System (EDA)
Project GuideProf. Chandrasekhar Ramanathan
Team Members:Bisen Vikrantsingh Mohansingh(MT2012036)
Kodamasimham Pridhvi(MT2012066)Vaibhav Singh Rajput(MT2012155)
Introduction
Reactive Data System Reactive Data System is a framework and
a software design approach that uses the principles of event-driven architecture for the design and implementation of data-intensive applications.
Event Driven Architecture EDA is a framework that promotes
production, detection, consumption and reaction to the events.
Event based applications will run on RDS framework.
Requirements
Functional Requirements API for registration of events and reactions to
application developer. Listener to check occurrence of Events Mapping of Events to their respective
reactions(SQL Query or Function call) Non Functional Requirements Cross-Platform and Load Balancing(threading) Flexible and Scalable in future Encryption of data to provide security
AnalysisChallenges - How to know event occurred?
Vendor specific functionNotify / alert
Trigger Pitfalls-
No Transaction (rollback or commit) Do not accept arguments / parameters No External Function call Slow
Custom ListenerWhat after event detected?
Thread per request Architecture
Design Approach and Architecture
EventEvent
Config.xmlConfig.xmlEvent TypeRepository
Event TypeRepository
ListenerListener
Caller UnitCaller Unit
ReactionRepositoryReaction
Repository
APIAPI
Invo
ke
Chec
k
(DB/xml)
(Thread per request arch.)
Application
EDA
Register
EventRepository
EventRepository
App. 1App. 1
Publisher APIPublisher API
Register
Chec
k
App. nApp. n...
trig
ger
Fetch
Para
meters
Call External Function
Set of Events & Actions for Admission Process
Mandatory ConventionTable on which DB event will occur should
have1 surrogate key1 column name for event detection status
Each Function registered as Action should have1 int parameter which will be surrogate
key of row got effected
Event & Action Registration – API [I]
/*
* REGISTER LIFECYCLE EVENT – Data State Change
*/
DB_Events dbe = new DB_Events();
//specify name of event, database Id , on which table it will happen and last is the name of surrogate key
dbe.register_Event("loginAction",1,"login","id");
//specify a set of rules for triggering event
String cons = " status = 'new' ";
//set constrainst
dbe.setConstraints(cons);
//Commit all the changes
dbe.save();
/*
* REGISTER ACTION as External Function call (You can register as many actions you want per event)
*/
FunctionReaction fr = new FunctionReaction();
//specify event_id, name and fully qualified function name which will be called whenever event occurrs
fr.registerReaction(dbe.getEvent_id(), "sendmail", "app.admission.SignUp.mailConformation");
fr.save(); This function must have 1 Int parameter, which will be surrogate key of row got effected
Event & Action Registration – API [II]
/*
* REGISTER MANAGEMENT EVENT - Timebased
*/
TimeEventsRegister time = new TimeEventsRegister();
// Specify EventName, DateTimeyyyy/MM/dd HH:mm:ss , int parameter
time.register_Event("RegistrationClosed" ,date Time, group_id);
//Commit all the changes
time.save();
/*
* REGISTER ACTION as External Function call (You can register as many actions you want per event)
*/
FunctionReaction fr = new FunctionReaction();
// Action I : Disable Registration
fr.registerReaction(time.getEvent_id(), “CloseApply" ,"admission.TimeEvent.setDisableGroupApply");
//Commit all the changes
fr.save();
// Action II : Seat Allocation
fr.registerReaction(time.getEvent_id(),”seatAllocate”,admission.Seatallocation.allocateSeat");
//Commit all the changes
fr.save(); This functions must have 1 Int parameter, which will be surrogate key of row got effected
Can be Embedded in Application (i.e., Publisher API), So even end users are also able to register their own events
Event & Action Registration – GUI [I]
Event & Action Registration – GUI [II]
Event & Action Registration – GUI [III]
Monitor Listener Unit
Revisiting Case Study – I (Admission Process)
ScenarioEnable Institute choice/Preferences filling and view status after Paying Fees
Disable Close Preferences filling & perform seat allocation after Round Closes
Some Interesting facts
• Response Time for Registration with Email verification link sending :
Without RDS With RDS
8.25 sec 0.25 sec
Individual Contributions
Bisen Vikrantsingh MohansinghEDA -Event Module (API)DatabaseUser Interface
Kodamasimham PridhviEDA - Dispatcher Module (Listener, Threading)Admission process Automation Architecture design
Vaibhav Singh RajputEDA - Action Module (External Function call)Time Based EventsTesting
Thank You