Saturday, 23 July 2016

CQRS (Command Query Responsibility Segregation)

CQRS

While reading handling exception in scala I came know CQRS.
While digging into CQRS found best article by Martin Fowler from ThoughtWorks.
It stands for  Command Query Responsibility Segregation pattern.
Basically it means separate your Create, Update, Delete operation (Command) from read (query).
But it seems more complicated as compare to daily CRUD model.
It has its won importance.
Following two figures show regular  CRUD model and CQRS model by Martin Fowler.

Regular CRUD Model


CQRS Model


Thursday, 14 July 2016

Java RMI (Remote Method Invocation)

As part of my current project, we have oracle as database and there is C++ component which talks to oracle 11g server. 
We have our Java apps that needs to talk this C++ Compound for DB Operation.
C++ Compound has API for CRUD operation.
We need to talks this C++ component using java.
First option comes in mind RMI.
This how we call our C++ component using RMI server.
We have RMI server installed on provide port.
Our Java apps talks to RMI server.
RMI server talks to C++ component using JNI. 

Following figure shows our architecture