MDA – for Infrastructure

Definition :
MDA – Model Driven Architecture
Model-driven architecture (MDA) is a software design approach for the development of software systems.

Source : https://en.wikipedia.org/wiki/Model-driven_architecture

The infrastructure components like the servers,load-balancers, routers can be expressed as models. We are already doing this, either on Visio or Draw.io or some other tool. In order to do the actual implementation
we need to use these diagrams as “reference” and not as working models, means I need to able to deploy.

Lets take an example, simple blogging site
1 host
LAMP Stack (linux OS,apache,php,mysql)

The modeling tool should be dynamic, instead of static.

The process can be represented as following steps:

diagram:

As your site become popular due to load on the application, change in the architecture to take more load.
following components and configuration got added. See the diagram below

There are many Critical problems to be addressed here by the tool;
1. How to address the infrastructure change?
There are 2 options:
Option #1:  directly update the infrastructure layers and then update the model
Option #2:  Modify the model, and deploy the infrastructure.

2. How to take care of the live data?
The data is critical for any business application. The tool should be intelligent enough to identify these critical info.

3. if the deployment fails, how to go back to working copy?
How to go back to good working copy, if there are any failures. Or we should have Primary-Secondary sites appraoch

4. Audit trail of the infrastructure model?
There are so many role in the infrastructure, once this is on production, this should be controlled, before deploying any change.

Conclusion:
Disadvantages with this approach:
The models can go complex over the time and difficult to read and interpret.

Few options I can think of:
we have to divide the whole infrastructure to multiple groups, so that easy to understand by humans and manage well.
As an alternative approach, we can have a Infrastructure description language, which helps to describe your infrastructure.

Sample Infrastructure Description Language:

Example #1:
appname:blogging-site

contains:
nodes:
image : linux
port: 8081

Example #2:
appname:blogging-site-lb
contains:
load-balancers
nodes:
node-1
node-2
db-node

load-balancers
connects-to:
node-1, node-2

node-1
image: apache-php
port: 8080

node-2
image: apache-php
port:8080

db-node:
image: mysql

Shutting down the Spring boot App using HTTP POST

1. Add the “actuator” dependency jar in pom.xml

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2. Enable HTTP endpoint in application.properties

endpoints.shutdown.enabled=true

3. POST to url using REST client or Postman

http://localhost:8080/shutdown

Postman :- top 3 things I use.

Tool:

www.getpostman.com : This tool is great help for the API Verification, testing.

How I’m using tool:

  1. To configure different Get, POST requests.
  2. Save the different request payload. Accordingly this is one of complex part, because as an application developer we have different scenarios to test and validate for the different dataset. Tools helps me to create the collections and save it.
  3. Save project in cloud: The common problem, we might lose the project if the laptop changed or you lost the data. You can save the project in cloud and later download the tool and sync. You have all your projects.

How to write this Chrome Extension?

Content-is-not-allowed-in-prolog : SAML Response

Recently, while integrating with the SAML based product, we encountered a problem “Content-is-not- allowed-in-prolog”

There are cases where SAMLResponse are Base64 encoded, the consumers ( SpringMVC Controller / Servlet) need to decode the response.

// code snippet
String responseMessage = httpServletRequest.getParameter(“SAMLResponse”);
byte[] decoded = Base64.decode(responseMessage);
ByteArrayInputStream is = new ByteArrayInputStream(decoded);

Android App :To connect to Telecon and Webex.

This Android App, makes the Phone as proxy for ourselves. Features:

– Read the calendar event.

– Extract the Telecon information , login to telecon with the passcode.

– Look for any webex url, login to Webex sessions from your phone.

– Also some automated message like, “this is me joining to the call”.

– The app also record the converstation. so that later the user can evaluate and delete.

some usage:

Joining to a meeting while driving.

 

 

Maven build failing due to OutOfMemoryError

Problem:

The following error is observed when the Maven Build is done. (mvn clean package)

The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space

Solution :

Set the environment variable MAVEN_OPTS=-Xmx1024m and then run the maven build command.

Reason:

The system resources memory is not sufficient to build your application.