Node
Node
Node
What is Node.js
• Node.js is a cross-platform runtime
environment and library for running JavaScript
applications outside the browser. It is used for
creating server-side and networking web
applications. It is open source and free to use.
It can be downloaded from this
link https://nodejs.org/en/
What is Node.js
• Many of the basic modules of Node.js are
written in JavaScript. Node.js is mostly used to
run real-time server applications.
• The definition given by its official
documentation is as follows:
• ?Node.js is a platform built on Chrome's
JavaScript runtime for easily building fast and
scalable network applications.
Different parts of Node.js
Features of Node.js
• Extremely fast: Node.js is built on Google Chrome's V8 JavaScript Engine, so its
library is very fast in code execution.
• I/O is Asynchronous and Event Driven: All APIs of Node.js library are
asynchronous i.e. non-blocking. So a Node.js based server never waits for an API
to return data. The server moves to the next API after calling it and a notification
mechanism of Events of Node.js helps the server to get a response from the
previous API call. It is also a reason that it is very fast.
• Single threaded: Node.js follows a single threaded model with event looping.
• Highly Scalable: Node.js is highly scalable because event mechanism helps the
server to respond in a non-blocking way.
• No buffering: Node.js cuts down the overall processing time while uploading audio
and video files. Node.js applications never buffer any data. These applications
simply output the data in chunks.
• Open source: Node.js has an open source community which has produced many
excellent modules to add additional capabilities to Node.js applications.
Installing Node.js
• Latest version of node can be downloaded from here.
• https://nodejs.org/en/.
• After the installation, from the comma`nd prompt type node –v and you
will get to see the node version.
Writing the first node application.
• Type this code and run in the command prompt as
shown below:
• File stream is read and chained to creted a zipped file of it and is placed in
another file named input.txt.gz. Output of one functionality is piped to
another is called chaining of streams.
Pipeline of streams.
• Pipeline can also be used of streams to output of one command to the
input of another. Pipeline code looks neater than pipe.
•
File read asynchronous and
synchronous way.
• File reading both in asynchronous and synchronous way.
Create and delete a file
• Unlink() is used to delete a file.
Create and delete a directory.
• Mkdirsync() is used to create a directory and rmdirsync() is used to
remove a directory or folder.
OS Module
• OS module will have information about the system and OS.
Path Module
• Path Module gives the information and functions of given path.
Net module
• Net module is used to have client server communication using socket
programming.
• Uses the net module. Creates the server. When any client is connected, it
displays a message as Client is connected. When the client ends the
connection then ‘end’ event is generated and ends the connection by
displaying message “Client disconneced”. When the client sends the data
then data event is generated and sent data is displayed. Server also sends
the data to the client using .write(). Finally server listening in the port
8080 so that client can connect to this port.
• Client code :
• Uses the net module. Creates the server. When any client is connected, it
displays a message as Client is connected. When the client ends the
connection then ‘end’ event is generated and ends the connection by
displaying message “Client disconneced”. When the client sends the data
then data event is generated and sent data is displayed. Server also sends
the data to the client using .write(). Finally server listening in the port
8080 so that client can connect to this port.
• Client code :
• Client connects to server at port 8080 and after getting connected with
the server it displays a message “Connected to Server”. When the client
receives message/data from server, net modules emits ‘data’ event.
When this event is gerenated, the received msg is printed. It also writes
to the server using .write() and finally disconnects with the server.
Output
DNS Module
Output
Domain module
• Domain module is deprecated in node.
Web Module.
• Web Server is a software program that handles HTTTP requests sent by
HTTP clients like web browsers, and returns web pages in response to the
clients. Web servers usually respond with html documents along with
images, style sheets and scripts.
• Most of the web server support server side scripts using scripting
language or redirect to application server which perform the specific task
of getting data from database, perform complex logic etc. and then sends
a result to the HTTP client through the Web server.
• Apache web server is one of the most commonly used web server. It is an
open source project.
Web Application Architecture
•A web application can be divided in 4 layers:
•Client Layer: The Client layer contains web browsers, mobile browsers or applications which can
make HTTP request to the web server.
•Server Layer: The Server layer contains Web server which can intercepts the request made by
clients and pass them the response.
•Business Layer: The business layer contains application server which is utilized by web server to
do required processing. This layer interacts with data layer via data base or some external
programs.
•Data Layer: The Data layer contains databases or any source of data.
Node.js provides http module which can be used to create either HTTP client of
server.
Web Application Architecture
•A web application can be divided in 4 layers:
•Client Layer: The Client layer contains web browsers, mobile browsers or applications which can
make HTTP request to the web server.
•Server Layer: The Server layer contains Web server which can intercepts the request made by
clients and pass them the response.
•Business Layer: The business layer contains application server which is utilized by web server to
do required processing. This layer interacts with data layer via data base or some external
programs.
•Data Layer: The Data layer contains databases or any source of data.
• //To remove fav.ico error add this line in index.html
• // <link rel="icon" href="data:,">
• // This refers to relation of ico and it is not pointing to null. It is not asking for fav.ico
• Substr() will start reading from 1st character as pathName contains “/index.html”
• Type index.html as shown below:
• Run the node js file and open the browser and type http://localhost:8081/index.html
Assignment on Node.
• (1) Have 2 listeners and connect it with the same event using .on() and emit the event.
• (2) Display the event names associated with the event emitter object using eventNames().
• (3) Create 2 listners for an event 'myevent' using add listnerers. emit the 'myevent' and
Display
• the count of event listners and the event listerns. Remove one event listern and Display
• the count of event listerns for 'myevent' and also which event is listening to 'myevent'
event.
• (4) Type the program on Reading a file and display the output. Do not have the file in the
directory
• and check the error it generates.
• (5) From the given the file, along with the data, also display number of characters, words and
lines
• in the file.
• (6) Write the script to search for a string in the file. Take the string from the user to serach
for
• (7) Print the number of occurance of the search string in the given file. Take the search string
from
• the user from command line.
• (8) Type the code to see the writing into a stream as shown in the class.
• (9) Copy one stream file to another. (Hint : Read from one file and write into antoher file)
• (10) Create a folder in node, creat text file in it using commanline. Delete this file using
unlink()
• of node and delete the directory using node.
• (11) Accept user input to create a folder and create the given folder and accept the folder
name to
• delete the folder and delete that folder.
• (12) Along with the given parameters of OS module, try the following parameters and see the
output. os.homedir() - Home Directory.
• JSON.stringify(os.networkInterfaces()) - Network Interfaces.
• os.platform() - OS Platform.
• os.release() - Release of the OS.
• +os.tmpdir() - Temporary directory.
• os.totalmem() -Total Memory in bytes.
• os.type() - This method returns the operating system name.
• os.uptime() - Total uptme of CPU in seconds.
• (13) For the DNS module, the code is given with fixed domain names. Perform the similar
operation
• given by taking domain names from the user.
• (14) Practice web module with http://localhost:8081/index.html.
• (15) With web module --> When the url is http://localhost:8081/getData --> Let the node
• return employee json object with the fields empid, name, dept and designation.
Day-3
JEST
• Jest is a JavaScript Testing Framework.
• Type sum.test.js
• Create package.json as: Debug is given by VS editor for debugging.
• In Matchers.test.js
• In Matchers.test.js
toContain()
• If the javascript function has returned an array then toContain() can be
used to check whether the element is there in the returned array or not.
• In Matchers.js
• In Matchers.test.js
• Output :
toContain()
• In Matchers, we are having a function to return the deparatments from a
function and Matchers.test.js we are testing one dept is there or not with
the returned array of departments.
• In Matchers.js
• Matchers.test.js
Setup and Teardown
• beforeEach() is called before every test script. afterEach() is called after
every test script is executed. beforeAll() is the first function which is
executed before all the testcaes. afterAll() is executed after all the test
cases are executed.
Assignment
• 1. Create functions for subtaction, multiplication division and test them using jest.
• 2. Write functions for
a. Find Largest of 2 numbers.
b. Largest of 3 numbers.
c. Factorial of a numbers
d. Check given number is even or odd. For Even it returns true else it returns false. use
toBeTruthy() or toBeFalsy() in jest
e. Largest element in the array.
f. Find whether the given element is there in the array or not.
and write the 6 testcases using jest to tese these functions are working fine or not.
• 3. Create array of 5 objects of Library domain which consists of the fields bookid, bookname,
author, cost. Create a function named returnBookDataById(num). This function will return
book record based on the book id. if the correct book id is sent then that record is returned
else null data will be returned. Create a jest test case to check this function
returnBookDataById(). Pass the correct data and check with matchers not.toBeNull() and
send wrong the bookid and check the result with jest matcher toBeNull().
Assignment
• 4. Create a function in javascript to store array of Objects of Library books. Have a map to
filter only the bookids and store them in an array. Return this array from the function. In
Jest, write a test script to check whether a bookid is there or in the list of BookIds returned
by the javascript function.
• 5. Create a Login funciont in javascript, This function takes two parameters. They are UID and
PWD. Login() will use global array of Objects and check whether the given user and pwd is
present as a record or not. If yes, this function will return as "Valid user“ else it will return as
invalid user. Write a Jest test script by sending valid uid and pwd and verify that Login() is
working Fine. Also send the wrong uid and pwd and check that Login() is returning as "Invalid
User"
• 6. Write a javascript function Named Registration(). This function takes 3 parameters they
are (a) UID (b)PWD (c) Role (Admin/User). Write a Jest test script to register a record in User
Array of Objects. Afer registraton, Registration() should return as "Registration is successful"
or failed to Register with a reason. Test for both the conditions in Jest testscript.
• 7. Write Jest test script to register a user first and after that with that user write a script to
Login() and Login() should return as
"Valid user".
Day-4
Elements tab in Developer tools
• 1. Developer tools can be opened by the keys Ctrl + Shift + I.
• 2. On the left hand side, toggle device tool bar is there, it is converting
from mobile mobile to desktop mode.
• 3. In the elements tab, click on docking to dock the way you want
developer tools to be.
• 4. Click on the device tool bar and select the kind of mobile you want to,
mobile, tablet desktop... Both portrait and landscape mode.
• 5. In the Elements tab, once the HTML is opened, it shown its html in
elements tab. We can change and modify the tabs, data, in this editor.
Double click on the text and modify it.
• 6. It also shows the css file which is used.
• 7. Right click on the element and can edit it and add the element in it,
duplicate the element, and can add attributes to the existing element.
• 8. In the toolbar first toolbar is select the element and then device style
and then elements link is displayed. On Click of the "Select the element"
in the toolbar, user can click on the item on the html page and its
corresponding code is displayed in the element tab of developer tools.
Elements tab in Developer tools
• 9. Select the element on html page and move to its code in the elements
tab and right click on it and select hide element. That element will be
hidden but it takes the space. It gets deleted only when we select delete
element, that element is removed and the space occupied is also deleted.
• 10. Select the element of the html page, right click on it, copy --> Copy the
element and it can be pasted anywhere in the page.
• 11. Select the element, lets say H1/H2 for example, once the cursor
changes to pointer, drag the element and can be placed anywhere.
• 12. Open a page with bootstrap navbar, click on navbar and move to that
code in dev tools element and click on .cls and here nav-bar style can be
changed with the check boxes.
• 13. Navbar - elements- styles - add a style for body background color and
color and open in dev tools elements - styles and Click on the background
color number and it can be modified and see which one is good.
• 14. Navbar-elements - computed - padding, border, margin all the fields
can be modified in here.
• 15. Filter can be used in Styles sub link of elements to filter the html
elements rather than seeing all the elements for better editing.
Console tab in Dev tools
• 1. Ctrl+Shift+J brings the console log.
• 2. Place a console.log ("hello") and it can be seen in the console link.
• 3. Add a variable which is not there and write in console as console.log
(test) --> it gives an error in console link and click on it, it displays where
• is the error in source link.
• 4. In the console link, java script functions can be tried.. Type
• alert ("Hello, how are you");
• confirm ("Are you sure, you want to delete");
• 5. console can be filtered on info, warning and errors.
•
Output
Sources tab in dev tools
• Sources tab is used to see the source of the code and also used for
debugging and also can be used as a editor for the script.
• To debug the code, a break point can be added and can be seen step by
step execution of the code.
Network tab in dev tools
• This tab is used to measure the performance of the file/files.
• Select doc for html and run the html in the browser and the user can see
the performance of that html.
• Throttling – Vary the network speed and check how the website is
performing with 3G network etc.,
Application tab in Dev tools
• Local Storage – Is the data created and accessed by client/front end (js). It
can be accessed by any window of the browser.
• Session Storage – It is same Local storage except that the data will be lost
if that tab is closed.
• Cookies – It is created and accessed by client and server. Expiry date for
cookies can be given. Cookie is the information which resides in the client
side.
• Indexdb and web SQL they are the databases and their data can be
viewed in here.
• Trust Tokens – For the trusted clients, it gives a token for the
authentication like JWT (Json Web Token).
Day-5 : Assessment
Day-6 : SQL
SQL statements
• CREATE TABLE Customer_MTX
• (ID int NOT NULL,
• Name varchar(50),
• Location varchar(50),
• PRIMARY KEY (ID)
• );
• select distinct (location) from customer_mtx Display all the distinct locations from
customer_mtx;
• select * from customer_mtx where (location = 'bangalore' and name = 'charan') or id = 3
• insert into customer_join(id, name, city) values (104, "Jyotsna", "UP")
• select * from customer_join where country IS NULL For NULL value checking.
• select * from customer_join where country IS NOT NULL
• select database() shows current select database.
• show tables Displays all the tables of the select db.
• update customer_join set name='charan' where name='chara'
• select * from customer_join limit 3 Shows 3 records.
• select * from customer_join limit 1,4 Start 2nd record 4 records are displayed.
• select min(cost), max(cost), count(*), avg(cost), sum(cost) from product_join
• select * from customer_join where name LIKE "%haran“ Display all the records which
ends with “haran”.
• select * from product_join where id in (select product_id from purchase) Displays all the
product information on the purchases done.
• alter table user1 add role varchar(25) Add a column.
• alter table user1 change column pwd password varchar(25) renames the column
• alter table user1 drop column role Drop the column.
• alter table user1 rename user2 Renames the tables name.
• truncate table tab1 Removes all the records.
• drop table tab1 Removes the table.
set autocommit=0
• rollback Rollsback the operation.
• select count(city), city from customer_join group by city Displays how many rows are
there for each city.
• select count(city), city from customer_join group by city order by city desc In addition to
above query, Sorts the city in descending order.
• select count(city), city from customer_join group by city having city != 'HYD' order by city
desc Having to have a new condition to the group by.
• Joins
• create table student_SQL (id int, name varchar(25), stream varchar(25), primary key (id))
• create table student_marks (id int, marks int, constraint st_marks foreign key(id) references
student_sql(id))
• insert into student_sql values (2,'charan2', 'cs');
• insert into student_sql values (3,'charan3', 'cs');
• insert into student_marks values (1, 80);
• insert into student_marks values (1, 80);
• insert into student_marks values (1, 80);
• insert into student_marks values (2, 80);
• insert into student_marks values (2, 80);
• insert into student_marks values (3, 80);
• alter table student_marks add column subject varchar(25)
• select s.name, m.subject, m.marks from student_sql as s LEFT JOIN student_marks as m ON
s.id = m.id
• select s.name, m.subject, m.marks from student_sql as s RIGHT JOIN student_marks as m
• For inner join when there are equal number of records in both the sides of the table.
• Employee table emp_id, name, address, city, country.
• Dept deptid, description, emp_id
• Here first table has inforation on Employee and second table has information on dept and
the employee works in that dept.
Output:
SELECT * from … ORDER BY
Order option is used to sort the fields. DESC also can be specified for the
descending order.
Output:
SELECT * from … with LIKE %
Create a operator constant Op which is obtained from seuqlize.op to provide
the optionof LIKE in the equery..
• Output
Executing SQL Queries using query()
query() can be used to execute SQL Query in Sequelize.
Output:
OR condition in SELECT
Sequelize Op can be used to sepcify OR condition too.
Output:
INSERT in a table.
Create() is used to insert data into a table.
Output:
INSERT in a table using build() and
Save()
Build() will create an object and it does not store in db. Save() will save the
record/object in the db which is created by build().
Output:
Bulk INSERT records using bulkCreate()
bulkCreate() is used to insert many records in one go in the database.
Output:
• Execut the js in command line as shown below:
Output:
Deleting a record () in Sequelize
Destroy() will remove record or records from the table.
Output:
• The problems of adding extra ‘s’ to the table by adding the flag
freezeTableName:true
• Provide the primary key in the structure defined so that it will not create
id field extra by default.
• Kashmiri record is deleted from the table of records. Before Varun record
in the screen shot, Kashmiri record was there previously. After executing
destroy(), Kashmiri record got deleted. It can be seen from the output
given.
Drop a table.
• Drop() is used to drop a table.
Assignments
• 1. Create a connection with the database and display the result. Stop the
DB and check and also see the error throws in sequelize.
• 2. Create a student table with the fields student_id, name, stream and
marks. Do not create student_id as the primary key and do not use
timestamp:false and freezeTable : true and observe the fields extra
sequelize is going to create and also observe the name of the
which is created.
• 3. Add few records to Student table and run the above code with
force:true in sync() and observe what is happening to the created data
for the students table.
• 4. Create Movie table with the fields MovieId, MovieName, Type of Movie
(Comedy/Romantic/Action etc.,), Language, cast with the following
options
(a) timestamps : false
(b) freezeTableName : true
(c) without force:true in sync() and
(d) Make MovieId as the primary key.
Observe what happens and add few records to this table and display the
result by findByAll().
•
5. Create the Employee table in db with the fields EmpId, name, dept and
designation. Make EmpId as the primary key. Add few records
to this table and display the rows of the table in sequelize. Add the flag
{raw:true} in findByAll() and see the difference.
6. In extension to above code (Employee table), Also display the record by
Primary Key whose empid is 1200. Have a record in the db
with empid 1200. (Use findByPk()).
• 7. Write a script to display all the records where name of the employee is
your name. (Add Where clause in the script.)
• 8. With Employee table, display all the employees with only fields Name
and their department.
• 9. Add a condition to above script, display all the employees who are
working in IT department.
• 10. Count the number of rows in the employee table using
findAndCountAll().
• 11. Display all the records sorted on employee names.
• 12. Display names of Employee table using like operator in sequelize.
• 13. Write SQL queries for all the operations we have done till now and
execute them using query() of sequelize.
• 14. Write the script to display all the students whose are in CS Stream
and have got more 75%. (Use Op.and)
• 15. Write a script to insert an employee into the employee table.
• 16. Insert a new record in employee table using build() and save().
• 17. Insrt set of records in student table using createBulk()
• 18. Update a record in employee table by changing your name to your
full name (First name and Last name)
• 19. Delete a record from employee table and see the output.
• 20. Drop the Student table using drop() and check the output.
21. Create two tables in SQL in workbench and establish a relationship
between them as Primary Key and Foreign key.
TABLE Customer //This holds the customer information
( ID int NOT NULL,
Name varchar(50),
Location varchar(50),
PRIMARY KEY (ID)
);
TABLE ProductOrders //This table holds the information on what and all the
products ordered by the customer.
ProductNumber int NOT NULL,
ProductDescription varchar (50),
Cost int,
ID int,
PRIMARY KEY (ProductNumber),
FOREIGN KEY (ID) REFERENCES Customer_Sequelize (ID)
Create few records in both the tables and establish a join based on ID of
both the tables and display the data. Write the SQL For the below
requirement and execute it in sequelize using query().
Means to say, for all the names display what and all they have purchased.
•
Day 9
Express JS
• Express.js is a free and open-source web application framework for
Node.js. It is used for designing and building web applications quickly and
easily. Web applications are web apps that you can run on a web browser.
Since Express.js only requires javascript, it becomes easier for
programmers and developers to build web applications and API without
any effort.
• When the client executes login.html, control comes to ‘/login’ of get and
the input parameters are read using req.query.<param name> given in the
html. We are validating the given input and responding to user
accordingly.
Output
• When the userid = Charan and password = admin, valid user is returned.
• For that, first the express js script.
•
• Run PostExpress.js file
• Run Login.html and enter data as charan and admin for user id and
password.
•
• Also test with postman :
•
Routing and HTTP Methods.
Routing is made from the word route. It is used to determine the specific behavior of an
application. It specifies how an application responds to a client request to a particular
route.
• Run the file :
• Employee object should have the fields : Id, name, dept and designation.
• 4. Create array of objects of employees with the fields id, name, dept and
designation and create below given functions in express and
• perform the actions as specified.
• (a) get - getAllEmployees() -- Returns all the employees of the array of
objects.
• (b) get - getEmployeeById() -- Takes the empid as the path param and
displays employee record based on given Id.
• (c) get - getEmployeeByName() -- Returns all the matching records with
the given name.
• (d) post - insertEmployeeData() -- Takes an object from input and inserts
into the array of objects and returns the string
• "Record inserted successfully" or "Unable to insert the record".
After this operation, verify in postman that given record
• is inserted by giving http://localhost:8001/getAllEmployees
• (e) put - updateEmployeeData() -- Takes an object and udpates that
record in array of objects. After this operation,
• verify in postman that given record is updated by giving
• (f) delete - deleteRecord() -- Takes the id as the path parameter and
removes the record on given id and returns
• the "Record deleted successfully" or "Unable to delete
record".After this operation, verify in postman that given record
• is deleted by giving http://localhost:8001/getAllEmployees
• (5) Define the table named Insurance and have the fields (a)
PolicyNumber (Primary Key) (b)Policy Holders Name (c)Policy Amt (d)
Maturity Amount (e) Nominee
• Define the following functions in express and data has to be fetched from
DB using Sequelize.
• (a)get - getAllPolicies - Retrieves all the policies in the table.
• (b)get - getPolicyById - Retrieves the record based on the given policy
id.
• (c)post - newRecord - Inserts the data in the Insurance table.
• (d) put - updatePolicy - Updates the policy record based on policy
number.
• (f) delete - deletePolicy - Deletes the policy record based on
policyNumber
• (6) Write Angular code for the above assignment and connects with
backend and complete the front end.
•
(7). First display the login screen. On successful entry of uid and pwd,
take the user to the next screen which is CRUD operations on Student. If
not let the user be in the login screen itself giving the right error message.
Also have the link in the login form for registering a user. On click of the
link "Register user", Registration form should be displayed. User should
be able to enter data in the Registration form and click on Register
button. On click of register button, data should go to backend and should
store in backend database. With the newly registered user, user should
be able to login. Please check this too.
•
Details of CRUD operations for the student domain.
• Student will have the fields (a) ID (b) Name (c) Stream (d) Marks (e)
Address (f) Location (g) Pincode (h) State (i) Phone number.
•
I.All the forms should be validated before sending it to the server.
• II.All the data should be validated in the server before processing,
whether the object is null or it has some data.
• III.Code review
• (a) should be done and all the variables, functions and classes should
have the meaningful names.
• (b) Performance of the code should be looked at. Also think about
how can I make this code better.
• (c) How can I make this page better, the look and feel. (Make the best
UX (User experience)).
• (d) Also look at memory foot print. Review the entire code and see
how can I save the memory without
• compromising on the functionality.
• (e) Comments should be there for every function, at least a line and
also for the complicated logic.
• IV. After the backend is done, all the functions of backend should be
tested in postman and screenshots should be
• submitted.
•
• All the above code should be written in Angular - Express and sequelize.
•
Project Directory Structure
• App.js Main file
• Routes directory All the routes are
mentioned in here.
• Controller All the business logic is given in
here.
• Models All the DB related code is in here.
• When the URL starts /Employee as the main route then route it to
employee which is EmployeeRoute.js. When the route is
http://localhost:8001/Employee/insertEmployee or
http://localhost:8001/Employee/getAllEmployees or
http://localhost:8001/Employee/updateEmployee or
http://localhost:8001/Employee/deleteEmployee/102 for all these
• Create routes directory and add the following
code EmployeeRoute.js
•
• In EmployeeController.js
•
• In EmployeeCRUD.js under model directory.
•
• Create LoginRoute.js under routes directory
and add the following code:
•
• Create LoginController.js under controller
directory and add the code in there:
•
Dev Ops
Dev Ops.
• What is Dev Ops : A compound of development
(Dev) and operations (Ops), DevOps is the union of
people, process and technology to continually
provide value to customers.
• DevOps and the application lifecycle
• DevOps influences the application lifecycle
throughout its plan, develop, deliver and operate
phases. Each phase relies on the others and the
phases are not role-specific. In a true DevOps
culture, each role is involved in each phase to some
extent.
DevOps Application Life Cycle.
Plan
•In the plan phase, DevOps teams ideate, define, and describe features and
capabilities of the applications and systems they are building. They track
progress at low and high levels of granularity—from single-product tasks to
tasks that span portfolios of multiple products. Creating backlogs, tracking
bugs, managing agile software development with Scrum.
Develop
•The develop phase includes all aspects of coding—writing, testing, reviewing
and the integration of code by team members—as well as building that code
into build artifacts that can be deployed into various environments. DevOps
teams seek to innovate rapidly without sacrificing quality, stability and
productivity. To do that, they use highly productive tools, automate mundane
and manual steps and iterate in small increments through automated testing
and continuous integration.
DevOps Application Life Cycle.
Deliver
•Delivery is the process of deploying applications into production environments in a
consistent and reliable way. The deliver phase also includes deploying and configuring
the fully governed foundational infrastructure that makes up those environments.
•In the deliver phase, teams define a release management process with clear manual
approval stages. They also set automated gates that move applications between
stages until they’re made available to customers. Automating these processes makes
them scalable, repeatable, controlled. This way, teams who practice DevOps can
deliver frequently with ease, confidence and peace of mind.
Operate
•The operate phase involves maintaining, monitoring and troubleshooting applications
in production environments. In adopting DevOps practices, teams work to ensure
system reliability, high availability and aim for zero downtime while reinforcing
security and governance. DevOps teams seek to identify issues before they affect the
customer experience and mitigate issues quickly when they do occur. Maintaining this
vigilance requires rich telemetry, actionable alerting and full visibility into applications
and the underlying system.
Benefits of Dev Ops
Speed
•Move at high velocity so you can innovate for customers faster, adapt to
changing markets better, and grow more efficient at driving business results.
The DevOps model enables your developers and operations teams to achieve
these results. For example, microservices and continuous delivery let teams
take ownership of services and then release updates to them quicker.
Rapid Delivery
•Increase the frequency and pace of releases so you can innovate and
improve your product faster. The quicker you can release new features and
fix bugs, the faster you can respond to your customers’ needs and build
competitive advantage. Continuous integration and continuous delivery are
practices that automate the software release process, from build to deploy.
Reliability
•Ensure the quality of application updates and infrastructure changes so you
can reliably deliver at a more rapid pace while maintaining a positive
experience for end users. Use practices like continuous
integration and continuous delivery to test that each change is functional and
safe. Monitoring and logging practices help you stay informed of
performance in real-time.
Scale
•Operate and manage your infrastructure and development processes at
scale. Automation and consistency help you manage complex or changing
systems efficiently and with reduced risk. For example, infrastructure as
code helps you manage your development, testing, and production
environments in a repeatable and more efficient manner.
Improved Collaboration
•Build more effective teams under a DevOps cultural model, which
emphasizes values such as ownership and accountability. Developers and
operations teams collaborate closely, share many responsibilities, and
combine their workflows. This reduces inefficiencies and saves time (e.g.
reduced handover periods between developers and operations, writing code
that takes into account the environment in which it is run).
Security
•Move quickly while retaining control and preserving compliance. You can
adopt a DevOps model without sacrificing security by using automated
compliance policies, fine-grained controls, and configuration management
techniques. For example, using infrastructure as code and policy as code, you
can define and then track compliance at scale.
What is SDLC
• The Software Development Life Cycle (SDLC) refers to a methodology with clearly defined
processes for creating high-quality software. in detail, the SDLC methodology focuses on the
following phases of software development:
• Requirement analysis
• Planning
• Software design such as architectural design
• Software development
• Testing
• Deployment
What is AGILE
• Agile is an iterative approach to project
management and software development that
helps teams deliver value to their customers
faster and with fewer headaches. Instead of
betting everything on a "big bang" launch, an
agile team delivers work in small, but
consumable, increments. Requirements,
plans, and results are evaluated continuously
so teams have a natural mechanism for
responding to change quickly.
AGILE Methodology
• Agile Scrum technique.
• Daily standup meetings.
• Preparing the stories.
• Having the story points for Stories.
• Burndown charts.
AGILE Software development
stages
Dev Ops Tools
JWT
• What is JWT web token:
• JSON Web Token (JWT) is an open standard (RFC 7519) that defines a
compact and self-contained way for securely transmitting information
between parties as a JSON object.
• The tokens are designed to be compact,[2] URL-safe,[3] and usable
especially in a web-browser single-sign-on (SSO) context. JWT claims can
typically be used to pass identity of authenticated users between
an identity provider and a service provider.
•
SSO
• How does SSO work?
• SSO works based upon a trust relationship set up between an application,
known as the service provider, and an identity provider, like OneLogin.
This trust relationship is often based upon a certificate that is exchanged
between the identity provider and the service provider. This certificate
can be used to sign identity information that is being sent from the
identity provider to the service provider so that the service provider
knows it is coming from a trusted source. In SSO, this identity data takes
the form of tokens which contain identifying bits of information about the
user like a user’s email address or a username.
SSO
How JWT Works.