Sunday, November 11, 2018

Enterprise Architecture

  EA role is to lay Architecture As-Is to To-Be

 
  • What is Enterprise Architecture

    • Enterprise Architecture is a collection of Strategic information that describes a business and the information and technologies necessary to operate the business.
    • Its often broken into four domains
      • Governance
      • Business (Process and Service)
      • information ( Applications and Data)
      • Technology
  • What is the value of EA?
    • Its s strategic information asset to be used to shape the Enterprise.
    • Its key to understand the current investments in IT and efficiency planning and directing future IT investments.

Zachman Framework

  • It is the fundamental structure for Enterprise Architecture
  • Its NOT the Methodology
  • It is typically depicted in 6X6 matrix with the communication interrogatives as columns and Reification Transformation as rows
  • Interrogatives includes - What, How, When, Who, Where and Why
  • Transformations - Scope, Concepts, Logic, Physics, Technology, Product
  • It provides view for Planners, Owners, Designers, Builders, Sub contractors

TOGAF ( The Open Group Architecture Framework)


  • It is a framework for Enterprise Architecture
  • It provides a comprehensive approach to the design, planning, implementation and governance of an Enterprise Architecture
  • TOAGF models Enterprise at 4 models
    • Business
    • Application
    • Data
    • Technology
  • TOGAF includes a methodology for defining IT in terms of set of building blocks. 
  • It also contains a set of tools, vocabulary, recommended standards etc.. 
What is EA Road Map
  • EA Road map describes current and target architecture and transition plan achieve the target.

SOA



  • SOA is set of design principles for building a suite of 
    • Interoperable
    • flexible
    • Reusable services
  • Principles also includes
    • Discoverable Service contracts
    • Loose coupling
    • Service Abstraction
    • Service Re-usability
    • Service autonomy
    • Service Stateless
    • Service Composability
SOA Patterns
  • ESB
    • Provides reliable platform for messages, queues, data transformations and service broker
  • Event Driven Messaging
  • File Gateway
  • Service Callback
  • Service Grid





Enterprise Architect should be well versed with 

  • Application Architecture Principles
  • Engineering Principles
  • Technology Architecture Principles
  • Data Architecture Principles
  • Information Technology Principles
  • General Principles

Application Architecture Principles

  • Start with services, Micro Services
  • Visualize Application Services
  • Control Service Access by Policy
  • Adapt to Blurred Application Boundaries
  • Protect Data Integrity
  • Think Cloud when Designing Back-End services
  • Think Mobile when designing UI or Front End
  • Design Data Model with CAP theorem
  • Use Separation of concerns
  • Use Event Processing in the Event world
  • Automate Context Discovery
  • Use in-memory data grid  & RDBMS
  • Component reusability and simplicity
  • De-coupling interfaces
  • Adherence to functional domains

Engineering Principles

  • Testability
  • Maintainability
  • Integrity
  • External Integration well defined
  • Ethics 
  • Management

Principles that also helps to build stable enterprises includes...

  • Build What Matters
    • Engineering effort is a scarce commodity. It should only be applied to the problems that "move the needle" for the company
  • Don't Repeat yourself
    • Every piece of system, sub-system, module, process must have a single, unambiguous, authoritative representation in the entire Enterprise
  • Don't live with broken windows
    • Fix Bad Designs, Legacy, Wrong decisions and poor code when you see them
  • Clear Code beats the Clever Code
    • Don't write the code that you can't debug at 3 Am (while drunk). Never name a variable like "data" or "info" if the implementation is hard to explain.
  • Be A Scientist
    • Science is systematic enterprise that builds and organizes knowledge in the form of testable explanations and predictions about the universe.
  • Collaboration On Time
    • Encourage peer support when 20% is done instead of 80% is done that allows more meaningful collaboration
  • Don't gather requirements, dig for them
    • Requirements are rarely lie on the surface. They're buried deep beneath layers of assumptions, misconceptions and politics. To think like to User work with a User.
  • Be Open
    • Constantly share the work with teammates and stakeholders. When in doubt, follow the steps: tell people the impact you're about to make, make the impact, then tell the people you made it.
  • Empathize and Respect
    • See possibilities not just problems. Respect humans not just the code.
  • Have a conviction
    • Great products and team come from the string beliefs
  • Seek Engineering maturity
    • Embrace accountability
    • Tackle Technical debt where and when it makes us faster
    • Leave it better
    • Keep Learning

Sunday, September 2, 2018

Hyperledger Fabric and Composer

Hyperledger Fabric

  • Hyperledger Fabric is a platform for deploying Blockbain networks. 
  • The Ledger, Smart Contract, and consensus between members are maintained by using Fabric Protocols 
  • Hyperledger Fabric offers high levels of performance, protection, and transaction privacy. Fabric is the leader in blockchain for business, and can enable modular components to suit various usecases. 
  • IBM Blockchain platform is built upon Hyperledger Fabric and, as a result a basic understanding of Fabric's components are architecture is important for developers and decision makers to understand.


Fabric consists of the following components

  • A ledger
  • Peers
  • A Channel
  • Chaincode
  • Ordering Service
  • Certificate Authority
  • HyperLedger Fabric Clint SDK

Hyperledger Composer


  • Composer is a open source development toolset and framework that accelerates the time it takes to write blockchain applications. instead of developing smart contracts from scratch, Composer provides a convenience layer and business-level abstractions to implement smart contract on Fabric.
  • Composer also makes it easier to connect to your business network from web and mobile app.
  • Composer helps you to define your business network using a custom modelling language and a small set of primitives, and then deploy the business network a Hyperledger Fabric.
  • The business network consists of participants, assets and transactions, access control lists. 
https://public.dhe.ibm.com/common/ssi/ecm/51/en/51016151usen/industry-platforms-unit-blockchain-white-paper-external-51016151usen-20180523.pdf

Generating Business Network Template




Monday, August 27, 2018

ECOMMERCE TOOLS or VENDORS

Tealium
Monetate
Strongview
Coremetrics
Border Free
Hawk Search
Moxie

Bazaarvoice
Reflektion
Arroweye

Conductor
OpinionLab
Telapart
Bluecore

Extole
Curalate
Tealeaf
Qualtrix
Foresee
Offer Pop

Saturday, August 18, 2018

Angular 6 - Material Module Usage

1) @angular/material is one of the new feature in Angular 6.

  • Add "@angular/material": "^6.3.0", in package.json and run npm install
  • after npm install run ng add @angular/material
  • generates Navigation component using 
    • ng generate @angular/material:material-nav
  • Add below import to app.component.ts 

import { BreakpointObserver, Breakpoints, BreakpointState } from '@angular/cdk/layout';
import { Observable } from 'rxjs';

  • Add below variable after an existing variable in app.component.ts file
isHandset: Observable<BreakpointState> = this.breakpointObserver.observe(Breakpoints.Handset);

  • Add the constructor after that variable.
constructor(private breakpointObserver: BreakpointObserver) {}

  • open and edit `src/app/app.component.html` then replace all HTML tags with this tags.

<mat-sidenav-container class="sidenav-container">
  <mat-sidenav
    #drawer
    class="sidenav"
    fixedInViewport="true"
    [attr.role]="isHandset ? 'dialog' : 'navigation'"
    [mode]="(isHandset | async)!.matches ? 'over' : 'side'"
    [opened]="!(isHandset | async)!.matches">
    <mat-toolbar color="primary">Menu</mat-toolbar>
    <mat-nav-list>
      <a mat-list-item href="#">Link 1</a>
      <a mat-list-item href="#">Link 2</a>
      <a mat-list-item href="#">Link 3</a>
    </mat-nav-list>
  </mat-sidenav>
  <mat-sidenav-content>
    <mat-toolbar color="primary">
      <button
        type="button"
        aria-label="Toggle sidenav"
        mat-icon-button
        (click)="drawer.toggle()"
        *ngIf="(isHandset | async)!.matches">
        <mat-icon aria-label="Side nav toggle icon">menu</mat-icon>
      </button>
      <span>Application Title</span>
    </mat-toolbar>
  </mat-sidenav-content>
</mat-sidenav-container>
Next, give it a style by open and edit `src/app/app.component.css` then add this lines of CSS syntax.
.sidenav-container {
  height: 100%;
}

.sidenav {
  width: 200px;
  box-shadow: 3px 0 6px rgba(0,0,0,.24);
}

IBM Blockchain platform

IBM Blockchain Platform makes use of the most prevalent and popular open source Blockchain technologies, and is big supporter and contributor to OS projects.



https://ibm-blockchain.github.io/develop/

Hyperledger is the Open Source platform for Blockchain technology managed by Linux Foundation.

 






IBM Blockchain Typical Solution Architecture





High Level Components

  • Execution Runtimes 
    • Hyperledger Fabric, Web, Embedded Node JS, Connection Profiles
  • JavaScript SDK 
    • Node JS npm modules like composer-client, composer-admin 
  • CLI 
  • REST Server
  • LoopBack Connector
  • Playground Web User Interface
  • Yeoman Code generator 
    • Angular Web App, Node JS app, Skeleton business network
  • VSCode and Atom editor plugins

Installation Steps

Step-1: CLI Tools


    • npm install --global --production windows-build-tools
    • npm config set PYTHON "C:\Users\stalam0\Python\python.exe"
    • npm install -g composer-cli@0.20

    • npm install -g composer-cli
    • npm install -g composer-rest-server
    • npm install -g generator-hyperledger-composer
    • npm install -g yo



      Step-2: Install Playground

      • npm install -g composer-playgound

        Step-3: Setup IDE

        • install VSCode and install Hyperledger composer extension



          Step-4: Install Hyperledge Fabric

          • mkdir ~/fabric-dev-servers 
          • cd ~/fabric-dev-servers
          • curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.tar.gz
          • tar -xvf fabric-dev-servers.tar.gz

          • cd ~/fabric-dev-servers
          • ./downloadFabric.sh

          Starting and stopping Hyperledger Fabric


          •  cd ~/fabric-dev-servers
          •  ./startFabric.sh
          •  ./createPeerAdminCard.sh
          • ~/fabric-dev-servers/stopFabric.sh, and start it again with 
          • ~/fabric-dev-servers/startFabric.sh.

          Start the web app ("Playground")

          •     composer-playground
           

          http://localhost:8080/login

          Thursday, August 16, 2018

          Bitcoin

          Bitcoin

          https://bitcoin.org/bitcoin.pdf

          It is A Peer - to - Peer Electronic Cash System

          1) Transaction

          We define an electronic coin as chain of digital signatures. Each owner transfers the coin to the next by digitally signing a hash of the previous transaction and the public key of the next owner and adding these to the end of coin. A Payee can verify the signatures to verify the chain of ownenrship

          2) Timestamp Server
          3) Proof-Of-Work
          4) Network
          5) Incentive
          6) Reclaiming Diskspace
          7) Simplified Payment Verification
          8) Combining and Splitting Value
          9) Privacy
          10) Calcualtions

          Wednesday, August 15, 2018

          Blockchain

          Blockchain 

          Blockchain is chain of BLOCKs where each Block contains value data without any central super vision. It is cryptographically secure and immutable.


          Blockchain is an incorruptible digital ledger of economic transactions that can be programmed to record not just financial transactions but virtually everything of value.



          Blockchain Technology is a decentralized database that stores the registry of
          assets and transactions across Peer to Peer Network and these transactions are secured through cryptography.


          Decentralized:

          It is said that Blockchain is decentralized because there is no central authority to supervise anything


          Consensus Mechanism

          Mechanism by which decentralized red reaches on over certain matters specific


          Miners

          Users who use their computational power to extract blocks



          Facts about Blockchain

          Transaction history is locked in the blocks of data that are then photographically linked together and secured.

          This creates an immutable and unforgeable record of all of the transactions across this network

          This Record is replicated on every computer that uses the network.

          Its not an app, Its not a company, I think its closest in description to Wikipedia.
          We can see everything in Wikipedia.Its composite view that constantly changing and being updated.We can also track those changes over time on Wikipedia and we can created our own wikis,


          On Blockchain, we can think of it as open infrastructure that stores many kinds of assets.

          It stores the history of custodianship, ownership and location for assets like the digital Currency Bitcoin, title of owner ship like IP.

          With all this, How Blockchain lower Uncertainty and how they therefore promise to transform our economic systems in radical ways ?

          Uncertainties in economics are like 

          1) not knowing who we are dealing with ( Identity Management) 

          2) not having visibility into a transaction ( Asset Tracking) 

          3) not having recourse if things go wrong. (Reneging on deals )

          Using Blockchain, we can create shared reality across non-trusting entities.

          All of these nodes in the network do not need to know each other or trust each other, because all of those have ability to monitor and validate the chain for themselves.

          Blockchain is persistent, transparent, public append only ledger.

          It does this through mechanism creating consensus between different parties that need not to trust.


          Industries that are using Blockchain

          • Supply Chain
          • Trade Finance
          • Healthcare
          • Identify Access Management
          • Banking











          Sunday, June 17, 2018

          Express JS



          Express JS is flexible NODE.JS web application framework that provides a robust set of features to develop mobile and web applications. 


          It also facilitates the rapid development of Node based Web Applications.


          Features of Express JS

          • Allows setting up of middle-ware to respond to HTTP Requests.
          • Defines a routing table which is used to perform different actions based on HTTP Method and URL



          Pre-Requisites

          1. Node JS
          2. MS SQL Database (for demo - any database can be used)


          Step-1


          Step 1: Create a package.json file.
          {
            "name": "<Application Name>",//e.g.  – node_app
            "version": "0.0.0",
            "description": "<Description about your application>",
            "main": "server.js",
              "dependencies": {
                  "express": "4.14.0",
                  "body-parser": "1.15.2",
                   "mssql":"3.3.0"
              },
              "scripts": {
              "start": "node server.js"
            },
            "author": {
              "name": "<Your Name>",
              "email": "<Your Email>"
            }
          }
          
          Step-2

          Step 2: Create server.js file.


          //Initiallising node modules
          var express = require("express");
          var bodyParser = require("body-parser");
          var sql = require("mssql");
          var app = express();

          // Setting Base directory
          app.use(bodyParser.json());

          //CORS Middleware
          app.use(function (req, res, next) {
          //Enabling CORS
          res.header("Access-Control-Allow-Origin", "*");
          res.header("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
          res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, contentType,Content-Type, Accept, Authorization");
          next();
          });

          //Setting up server
          var server = app.listen(process.env.PORT || 8080, function () {
          var port = server.address().port;
          console.log("App now running on port", port);
          });

          //Initiallising connection string
          var dbConfig = {
          user: "<username>",
          password: "<password>",
          server: "<severName>",
              database: "<database",
              port: "<port>",
              requestTimeout: '10000',
              debug: true,
              dialect: "mssql",
              options: {
          encrypt: true // Use this if you're on Windows Azure
          }
          };

          var pool = function(){
          var conn = new sql.Connection(dbConfig, function(err){
          var request = new sql.Request(conn);
          //console.dir(request);
          return request;
          });
          return conn;
          }

          //Function to connect to database and execute query
          var executeQuery = function(res, query){
              var dbConn = new sql.Connection(dbConfig);
              dbConn.connect().then(function () {
                  var request = new sql.Request(dbConn);
                  request.query(query).then(function (recordSet) {
                      //console.log(recordSet);
                      res.send(recordSet);
                      dbConn.close();
                  }).catch(function (err) {
                      console.log(err);
                      dbConn.close();
                  });
              }).catch(function (err) {
                  console.log(err);
              });
              
          }

          app.get("/api/dpc", function(req , res){
              var query = "select count(*) as count from [schema].[table]";
              executeQuery(res,query);
          });
             

          Step -3


          npm install 


          Step-4

          node server.js

          The node server will start running into port number 8080 with corresponding API Routes; you can point to the below URL to test the application.



          Node JS

          Node.JS is powerful JavaScript framework built on top of Google Chrome's JS V8 Engine. 

          It is used to develop I/O intensive web applications like video streaming sites, single-page applications, etc.. Node.JS is open source and used by thousands of developers around the world.


          Advantages

          1. Quick & easy development
          2. High performance
          3. Run on single thread to handle multiple concurrent requests
          4. Easy to write API and interaction code
          5. Streaming support
          6. Monitoring possibilities
          7. Authentication support
          8. Lightweight, fast, and scalable

          Saturday, June 16, 2018

          Micro Service Introduction

          A microservice is a single self-contained unit which, together with many others, makes up a large application. By splitting app into small units every part of it is independently deployable and scalable, can be written by different teams and in different programming languages and can be tested individually.






          PROs of Microservices architecture:
          • The application takes lesser time to start, which increases developers productivity and speeds up deployments.
          • The system can be scaled easily and boost system performance.
          • Each service can be deployed without affecting other services, which allows deployment of new versions of services frequently.
          • Microservices are independent of each other and have a specific role. Changes made to one microservice does not affect other.
          • No restriction of technology in developing any service, there by making system technologically independent.
          CONs of Microservices:
          • Deployment complexity increases as the need to manage a system comprised of many different service types.
          • The developer needs to handle complexity for creating separate distributed system.

          Microservices versus monolithic architecture when application grows

          Monolithic
          • Understanding huge code base becomes difficult, especially for new developers.
          • Large code files make development environment slow like IDE.
          • Changing technology or language becomes complicated as the code base is tightly coupled.
          • CI/CD becomes challenging and time-consuming and needs a dedicated team to manage it.
          Microservices
          • Microservices are small and specific to business requirements.
          • Microservices are loosely coupled and can be easily developed and deployed.
          • Development can be done using different technologies.
          • Microservices can be built with new technology stack enabling faster development cycle.
          • Microservices can be easily scaled on demand.

          Why Microservices with Node.JS
          • Productivity – Node.js uses NPM (node package manager) which comes up with tons of ready to use modules which speed up the development process. Node.js uses javascript as interface language so that same language can be used for back end and front end. This saves lots of development time.
          • Performance – Node.js event driven I/O model along with microservices strategy which can handle an extreme amount of load with lesser response time.
          • Developer Friendly – Node.js has vast community support and is backed by millions of developers across the globe. Node package manager (NPM) contains more than 4 million ready to use modules which serve as heaven for developers. Node.js enables faster development of applications which are easily scaleable, there by making the developer happy through out application development life cycle.
          Node.js supports multiple Microservices framework which enables development of application based on microservices strategy. Most popular among them are Senaca js.  Senaca js provides a complete environment for the development of the microservice based application.

          x