Featured Post

Event Sourcing Video from Michael Ploed

Event Sourcing I want to share a great video I found few days ago that describes very well what Event Sourcing is.

Wednesday, January 31, 2018

NOSQL ADVANTAGES

  • Schemaless data representation: Almost all NoSQL implementations have schemaless data representation. You don’t have to think far ahead to define a structure.
  • Speed: deliver in milliseconds rather than hundreds of milliseconds (especially over mobile).
  • Plan ahead for scalability: avoid to fall into the ditch and then try to get out of it.

Tuesday, January 30, 2018

ACID VS BASE

ACID

Traditional RDBMS applications have focused on ACID transactions:
  • Atomicity: Everything in a transaction succeeds lest it is rolled back.
  • Consistency: A transaction cannot leave the database in an inconsistent state.
  • Isolation: One transaction cannot interfere with another.
  • Durability: A completed transaction persists, even after applications restart.

BASE

  • Basic availability: The system available most of the time and there could exists a subsystems temporarily unavailable.
  • Soft state: The state of the system may change over time, at times without any input (for eventual consistency).
  • Eventual consistency:The database may be momentarily inconsistent but will be consistent eventually.

Monday, January 29, 2018

CAP THEOREM

It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees:
  • Consistency: All nodes see the same data at the same time
  • Availability: Node failures do not prevent other survivors from continuing to operate (a guarantee that every request receives a response about whether it succeeded or failed)
  • Partition tolerance: the system continues to operate despite arbitrary partitioning due to network failures
“Of three properties of shared-data systems (Consistency, Availability and tolerance to network Partitions) only two can be achieved at any given moment in time.”

Sunday, January 28, 2018

Composed Message Processor, Scatter-Gather, Routing Slip


Composed Message Processor

Composed Message Processor is used to process a composite message. It splits the message up, routes the sub-messages to the appropriate destinations and re-aggregates the responses back into a single message.

Scatter-Gather

Scatter-Gather broadcasts a message to multiple recipients and re-aggregates the responses back into a single message.
  
The Scatter-Gather routes a request message to the a list of recipients. It then uses an Aggregator to collect the responses and distill them into a single response message. There are two variants of the Scatter-Gather that use different mechanisms to send the request messages to the recipients:

·         Recipient List: the list of recipients but the Scatter-Gather has to be aware of each recipient's message channel.
·         Scatter-Gathers use a Publish-Subscribe Channel to broadcast the request to any interested participant..

Routing Slip


Attach a Routing Slip to each message, specifying the sequence of processing steps. Wrap each component with a special message router that reads the Routing Slip and routes the message to the next component in the list.

Wednesday, January 17, 2018

CANNOT OPEN ECLIPSE WORKSPACE

A possible solution when Eclipse does not open the workspace is to backup your .metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi (workbwnch.xmi_bk) and edit the file workbench.xmi commenting the tag:
<!--
  <persistedState key="memento" ....</>
-->


Thursday, January 11, 2018

MYSQL FUNCTION




DELIMITER $$
CREATE PROCEDURE insertIntoTable(IN NumRows INT)
    BEGIN
        DECLARE i INT;
        SET i = 1;
        START TRANSACTION;
     WHILE i <= NumRows DO
      INSERT INTO `TableOne` (`ID`,`DATE`,`EXT_PLATFORM_PARENT_ID`) VALUES (i,sysdate());
          SET i = i + 1;
        END WHILE;
  COMMIT;
    END$$
DELIMITER ;

DELIMITER $$
CREATE PROCEDURE insertThread(IN NumRows INT)
 BEGIN
  DECLARE i INT;
        SET i = 1;
   WHILE i <= NumRows DO
   CALL insertIntoTable(2000);
   SET i = i + 1;
   END WHILE;
    END$$
DELIMITER ;

CALL insertIntoTable(20);


Wednesday, January 10, 2018

ORACLE FUNCTION


BEGIN  
FOR myCounter IN 110000..120000 LOOP 
INSERT INTO "TABLEONE" ("ID", ROW_CREATION, NATIVE_ID)  VALUES (myCounter, sysdate,DBMS_RANDOM.VALUE); 
END LOOP; 
COMMIT; 
END;


DECLARE
    srcAddress varchar2(255);
BEGIN 
    FOR x IN (select "ID" from TABLEONE) LOOP
        FOR myCounter IN 1..5 LOOP 
         INSERT INTO "TABLETWO"  ("ID",TABLEONE,ROW_CREATION) VALUES(myCounter, x."ID", sysdate);
        END LOOP;
    END LOOP;
END;