Author Archives: Ajitesh Kumar
MongoDB – How to Enable Authentication on Mongo Database
Beginners starting with MongoDB would come across the requirement of enabling authentication on MongoDB database. This blog presents tips and code sample on how to enable login on MongoDB database such that one would require to pass their user credentials in order to access the database. In order to enable authentication for MongoDB databases, following can be done. This would essentially mean that users would have to provide user credentials in order to access a specific database. Otherwise, anyone can access any database using command such as mongo. Apply following changes in /etc/mongod.conf file. Note that mongod.conf is configuration file where other details such as data path can also be found. Start mongodb with –auth option. As …
MongoDB Command to Evaluate Query Performance
Following command can be used to evaluate query performance of a MongoDB Collection: The above command would print result such as following. COLLSCAN represents the collection scan. Query Performance Metrics Following are some of the metrics to watchout for when evaluating query performance: totalKeysExamined: Total number of index entries scanned totalDocsExamined: Total number of documents scanned to find the results. executionTimeMillis: Time required to excute the query
Spring Boot with JSP Pages – Code Example
Following needs to be done to setup Spring boot web app with JSP pages Create a Spring Starter Project Create a Spring Starter Project by selecting “Web” as one of the dependencies. This will create a Springboot project. POM.xml Entries Place following entries in pom.xml for processing JSP pages Configuration in application.properties Place following configuration in application.properties Create Controller class Create a sample controller class such as following: Create JSP pages Create a folder src/main/webapp/WEB-INF/views Create a file index.jsp. Place the content such as following: Run Project as Spring Boot App Access URL such as http://localhost:8080/ in browser. Following would be displayed.
MongoDB – Evaluate Query Performance using Indexes
This blog represents commands used to manage MongoDB indexes on a particular collection and tips on how to evaluate query performance with or without indexes. Please feel free to suggest. Sorry for typos. Why create indexes? Indexes can significantly improve the read query performance for MongoDB collections. In absence of indexes, when searching for documents based on filter criteria, MongoDB performs collection scan, i.e., scan every document and returns the documents matching the filter criteria. This is not very efficient way of searching the document. In case of one or more fields which are frequently used for filtering out the document, it is recommended to create indexes on those fields. …
Springboot MongoDB Repository – Code Example
This blog represents code required to create a Spring boot application that uses Spring Data MongoRepository interface to connect with MongoDB database. Step 1: Create a Springboot Maven project Create a new Spring Starter Project using Eclipse IDE. This would create a class annotated with @SpringBootAnnotation. Step 2: Include Spring Data Mongo support in pom.xml Step 3: Configure Mongoclient for database connectivity Create a Configuration class which is used to instantiate a MongoClient for connecting with MongoDB database. Step 3: Define MongoDB details in application.properties Step 4: Invoke MongoRepository instance Place following code in SpringBootAnnotation class for invoking MongoRepository instance (UserDAO in the code given below). In ideal scenario, you would want …
MongoDB – Top 10 Most Common Commands for Beginners
This article represents top 10 most commonly used commands for MongoDB beginners. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following is the list of these commands: Following is the list of these commands: Login into MongoDB: Following command can be used to login into MongoDB database for a particular database. Make sure that the user with credentials such as username and password exists in the database mentioned in place of dbname. Show all databases: Once logged in as a user with appropriate role as userAdmin or userAdminAnyDatabase, one can see all the databases using command such as …
Configure Bitbucket Webhook to Trigger Jenkins Builds on AWS EC2
This article represents steps required to configure BitBucket Webhook to trigger Jenkins Builds on AWS EC2 based on code committed in the repository. This essentially means that a code commit in the BitBucket code repository would trigger a build in Jenkins server running on AWS EC2 machine. This forms the starting point of continuous delivery pipeline. The jenkins build, when triggered as a result of code push, could perform tasks such as some of the following: Run the build, Run tests Publish build artifacts in artifactory Deploying the build artifacts in different environments including QA, UAT and production. Please feel free to comment/suggest if I missed to mention one or …
How to Setup Jenkins & GitLab using Docker Containers
This article represents code sample on how to setup Jenkins & GitLab using Docker containers. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Create a docker compose file such as docker-compose.yml with the code given below. Executing command such as “docker-compose up” would lead to creation of two containers, one of which hosts the Jenkins and another one hosts GitLab. The Jenkins can be accessed with URL such as http://localhost:28080. The GitLab can be accessed using URL such as http://localhost. In case of running this docker-compose file on Linux/Ubuntu, change the volume under jenkins from “- /usr/local/bin/docker:/usr/bin/docker” to “- …
Angular – Reactive or Template-driven Forms?
This article represents quick introduction to two different kind of forms which can be created in Angular 2 or Angular 4. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points discussed later in this article: Template-driven forms Reactive forms Template-driven forms Template-driven forms are the most trivial type of form that can be quickly created in Angular 2. Following are key aspects of creating template-driven form. These forms are asynchronous in nature. These forms require inclusion/import of FormsModule in the root module, AppModule which is placed in the root folder of the app. Following …
Top 5 Performance So-called Concerns of Meteor JS
Many working with Meteor JS wonders about performance concerns associated with Meteor JS. This blog points some of those concerns and represents my opinion on why they are invalid concerns. Database as a Bottleneck Inability to handle heavy read-write loads, especially, write load/performance; However, with latest releases of MongoDB, MongoDB is good enough to easily handle very large data requirements of read/write. Following are related details: MongoDB supports different techniques to scale out appropriately based on the read-write requirements. They are as following: Secondary reads (reads from slaves, writes from primary/master). Sharding techniques MongoDB (3.0+) has come up with new storage engine, WiredTiger, which supports document-level concurrency control for write …
Top 9 Reasons to Choose Meteor JS for Mobile App
This blog represents top 9 reasons due to which one could still go with or choose or adopt Meteor JS to develop his/her next mobile app. Higher Developers’ Productivity owing to Quicker Releases Keeping in mind how quickly apps can be developed, tested and released, Meteor can still be preferred choice due to some of the following reasons: Ease of programming as Javascript is used on both frontend and backend. This could prove very beneficial and cost-effective for business to find JS developers and train them appropriately to develop full-stack app with Meteor. Ease of collaboration within team as developers have similar concerns to take care. Full-stack Javascript framework …
6 Key Elements of DevOps based Software Development
This article represents key aspects of DevOps approach which can be used to achieve continuous delivery/continuous deployment of software unit thereby achieving key business object of low-time-to-market and competitive edge. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. List of 6 Cs which are core to DevOps Approach Following diagram represents key aspects in achieving continuous delivery/deployment of a software unit while working based on DevOps approach. Collaborative Development Continuous Integration Continuous Testing Continuous Deployment or Release Continuous Feedback Continuous Monitoring
AWS – Steps to Achieve Continuous Delivery of Microservices Containers
This article enlists the key steps that would be required to create a continuous delivery setup for pushing cloud-native app (microservices with Docker containers) on AWS Cloud platform. Each of the points listed below will be detailed in separate blogs. Setup Jenkins with Git Setup Springboot microservices within Docker container Integrate Jenkins with AWS EC2 Container Registry (ECR) Setup AWS EC2 Container Service (ECS) Setup ECS Cluster with one EC2 instance Create ECS with a task definition and ELB (Elastic Load Balancer) Setup Setup a Web app using microservices Following apps/tools will be used to achieve above objective: Jenkins Git Springboot microservices Docker Containers AWS cloud services such as ECR, ECS, …
Spring Boot Web Application with Eclipse in 5 Clicks
This article represents tips and code samples to get you started quickly with Spring web application within few clicks. Please feel free to comment/suggest if I missed mentioning one or more important points. Also, sorry for the typos. Steps to get started with Spring Boot Web Application Go to Help > Eclipse Marketplace… and search type “spring sts” in Find text field under Search tab. Install the entry with the title such as “Spring Tool Suite (STS) for Eclipse Release”. Once installed, you would be asked to restart the Eclipse. Go ahead and restart the eclipse. Open the new Project selector window using shortcut, CTRL + N. Type “Spring Starter” …
Top 6 Freelance Jobs Websites for 2016-2017
This article represents top 6 websites (for the year 2016-2017) where job seekers could find freelance jobs, assignments or projects. Those working in IT and software industry (especially web or UI/UX developers and designers) will find them very useful. Please feel free to comment/suggest if I missed to mention one or more important websites. Also, sorry for the typos. Top 5 Freelance Websites List Following is the list of website (in order) Upwork Fiverr Freelancer Guru FlexJobs PeoplePerHour Find below the Google Trends on above websites:
AngularJS, Angular-UI Router Hello World Starter App – Code Sample
This article represents code samples to get started with an AngularJS app with Angular UI-Router and Bootstrap. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Code Example – AngularJS 1, Angular UI-Router, Bootstrap Pay attention to some of the following in the code given below: Angular-UI router state information is used to associate links with templates Angular-UI code with within tag element “ui-view” to load specific views <!DOCTYPE html> <head> <title>My AngularJS App</title> <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css” integrity=”sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u” crossorigin=”anonymous”> </head> <body ng-app=”myApp” class=”container”> <div class=”page-header”> <h1>Angular 1 – Angular UI Router</h1> </div> <div class=”container-fluid”> <div class=”row”> <div class=”col-sm-3 col-lg-2″> …
I found it very helpful. However the differences are not too understandable for me