Setting up MongoDB Cluster and Replica-Set

Database Replication

Database replication is a process in which we run a set of database instances that maintain the same datasets and it provides redundancy and promises high availability of database servers. In case your one database falls down then you still will be able to use the other available database from the cluster and have the same datasets that you had in your previous replica. 

In this post, I am going to demonstrate the replication setup in MongoDB. If you're using some other database you might need to check if your database supports replication or not.

A Few Tips for Improving the Performance of Your Web Applications

In this post, we will mostly be talking about a few things that we should keep in mind while writing web APIs to get the best possible performance out of them. Most organizations work with large amounts of data that need to be processed every second. So, it's very important to keep things organized and optimized in order to deliver a great user experience. Let's discuss a few points to help you understand how we can work more of performance optimization.

Virtual Tables

If you're using MySQL or any other SQL-based database, using virtual tables is the best thing that you can do. Let's look at an example. I have three databases and in a single query I am fetching data from four different tables. This process may take some time. In that case, you can create virtual tables in your SQL databases, which are sometimes referred as views, and keep all the columns that you want to retrieve from all four tables. This time, instead of looking at all four tables, the query will pull everything into a single table. This will help to reduce the response time.

Running SonarQube Inside a Docker Container

Prerequisite

To follow this article, one will need to make sure that they have docker installed in their machine. I assume you know using docker containers. I will be analyzing a maven project, so please make sure that you've one maven project with some code that you can analyze.

Introduction

Sonarqube is a prevalent tool for analyzing bugs, Vulnerabilities, Security hotspots, and some other programming standards. You can use this tool to analyze your project's source code to keep your code standing with programming standards. Using SonarQube is very easy. You can download the sonar server from the official site, but we will be running SonarQube inside a docker container to analyze our source code in this article. 

Authorization Code Grant Flow With Spring Security OAuth 2.0

Introduction

We have learned about OAuth - 2.0 specification in previous articles and how we can implement OAuth - 2.0 client credentials grant flow working with spring's authorization server. In this article, we're going to see how we can implement authorization code grant flow get working with spring security. 

According to the OAuth-2.0 specification, authorization code grant flow is a two-step process mainly used by confidential clients(a web server or secured application that can promise the security of credentials). In the first step, we request the authorize endpoint to get authorization code from the authorization server and then use it to get an access token from the authorization server at the token endpoint.

Introduction To OAuth Framework

You must have heard this word Oauth if you are from a development background. It is because of its popularity, in a few past years technology has evolved a lot and so the security. With increasing concerns of security, a lot of frameworks and patterns came into the picture and Oauth was one of them. When developers started using Oauth, they found it very secure and useful, and with increasing popularity, so many organizations started using this. 

Now, you will notice that millions of applications are now powered by the Oauth authorization framework. It's important that you know what it is all about and I think that's why you are reading this article.