Executing SQL Queries directly from Jenkins via Execute shell

mysql --host="qa-db-1234.eu-west-1.rds.amazonaws.com"  --port="3306" --user="automation" --password="automation@12&3" --database="Teachers" -e "Select * from  personalDataTable";

Executing SQL Queries directly from Jenkins via javascript file

//To Check node is installed in Jenkins
node -v
//To Check npm is installed in Jenkins
npm -v
//Install mysql
npm install mysql

//passing file name and parameters so that javascript file can execute query based on parameters
node $FILENAME $QA_DB_HOST $QA_USER $QA_PASSWORD
e.g. node demo.js qa-db-1234.eu-west-1.rds.amazonaws.com automation "automation@12&3"

Javascript file : demo.js

var mysql = require('mysql');var arguments = process.argvvar con = mysql.createConnection({host: arguments[2],user: arguments[3],password: arguments[4],database: "Teachers"});con.connect(function(err) {if (err) throw err;con.query("Select * from  Teachers.personalDataTable", function (err, result, fields) {if (err)throw err;console.log(result);process.exit(0);});});console.log("argument : ",arguments[2]) 

--

--

Application Load Balancer

  • It automatically distributes incoming traffic to different backend.
  • ALB works on layer 7 of the OSI model.
  • Infrastructure is managed by AWS, which can be horizontally and vertically scaled.
Application Load Balancer
  • AWS Lambda : Compute service that runs your code in response to events and automatically manages the compute resources.
  • Amazon EC2(Elastic Compute Cloud) : Resizable compute capacity in the Cloud.

API Gateway

  • Fully managed and server-less API service from AWS.
  • Infrastructure is managed by AWS, which can be horizontally and vertically scaled.
  • API Gateway basically act as an abstraction layer so that Frontend doesn’t have to worry about the backend micro-service.

--

--