In this article, I would like to show how spring boot application can be integrated with MongoDB (Schema-Less, Document Based NoSQL Database). To know more about MongoDB, refer here.

I have created a simple Spring Boot application with UserInfo as the entity. This adheres to the document containing user information. Moreover UserInfo also has some embedded documents like Name, DOB, Location etc.

Maven Dependencies:

To start with, created a spring boot application with below maven dependencies.

In this article, we would see the steps to enable authentication and authorization on MongoDB. Authentication and authorization might sound similar, but they are distinct security processes in the world of identity and access management (IAM).

Authentication vs Authorization:

  • Authentication is the act of validating that users are whom they claim to be. This is the first step in any security process.
  • Authorization in a system security is the process of giving the user permission to access a specific resource or function.
  • In secure environments, authorization must always follow authentication.
  • Users should first prove that their identities are genuine before…

Data are generally stored in the form of Files residing in a Folder Structure within Storage Devices. Storing & Retrieving Data (coined as I/O Operations technically) play a significant part in performance eventually determining the customer experience in one way or other.

Same Data if organized in a proper way (Data Modeling), we can widely improve the I/O Operations. There are two nature of handling data within a database (broader perspective),

  • SQL (Structured Query Language) — Structured way of maintaining data (which are stored onto tables with fixed columns with fixed data types).E.g., Oracle, SQLServer, PostgreSQL, MariaDB etc
  • No-SQL —…

In this article, we would be looking at scalability, high availability and how load balancers help in designing highly scalable and highly available applications.

Scalability — Ability of application/system to handle greater loads by adapting themselves. Two types of scalability are Vertical Scalability and Horizontal Scalability.

Vertical Scalability:

  • Scalable by increasing the size of the EC2 Instance.
  • e.g., consider our application runs on t2.micro EC2 instance. Vertically scaling them would result in running this app on higher configuration EC2 instances like t2.large.
  • Vertical Scalability is common for non distribution systems like database (RDS, Elastic Cache etc)
  • However, there is always…

Operating System (OS) has two means of communication channels for users to interact with them— GUI (Graphical User Interface) and CLI (Command Line Interface).

In case of Linux based OS, shell commands are used on CLI. GUI comes up with additional RAM Consumption and hence some system like Routers (built by CISCO operating on customized OS based on Linux) have only CLI enabled.

Similarly, Hypervisor (also known as Virtual Machine Monitor VMM) also have this OS with limited features only on CLI to improve performance.

The shell is an interactive interface that allows users to execute other commands and utilities…

EFS stands for Elastic File System. It is managed by NFS (Network File System) that can be mounted on many EC2 Instances across many Availability Zones (AZ). EBS can be attached to single EC2 Instance at a point of time whereas EFS can be mounted to multiple EC2 Instances. Hence, in case of EFS, files are shared across different EC2 Instances (provided they get mounted to same EFS).

EFS are highly available, scalable and expense (3*gp2) and they follow pay per use model (Means, EFS are billed only for the size used whereas EBS is billed based on predetermined configuration…

AMI (Amazon Machine Image) provides the information required to launch an EC2 instance. We must specify an AMI when we launch an instance. We can also create our own customized AMIs as well and make them private/public based on our needs. Default visibility of custom AMI is private.

We can customize an AMI based on our own software configuration, operation system, monitoring capabilities etc. Biggest advantage of using customized AMI is that it enables faster boot/configuration time because all our software are prepackaged.

AMI are built for a specific region and similar to snapshots of volumes, can be copied across…

EBS Volumes:

EBS(Elastic Block Storage)Volume is a network drive (not a physical drive) that we can attach to EC2 Instances on the fly. It allows EC2 Instances to persist data even after their termination. EBS Volume can be only mounted to one EC2 Instance at a given point of time even though it can be detached and mounted to different EC2 Instance. However, one EC2 Instance can have one or many EBS Volumes mounted to it. An analogy for EBS Volumes would be to think of them as “network USB Stick” which can be attached/detached.

Delete on Termination” attribute…

First thing we have to do is to have an EC2 Instance launched. If not available, please create a new EC2 Instance. Steps to launch an EC2 Instance have been detailed out on

Once we have our EC2 Instance up and running, try to connect to that instance remotely (via Putty if connected via windows or via ssh username@hostname on Linux machines)

Step 1: Type sudo su command to switch to root account

Login to AWS Console and choose Services →EC2 which would land onto EC2 Dashboard.

Nagarajan Sivathanu

Software Craftsman who loves to explore and evolve

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store