Tuesday 15 December 2020

Connecting to MongoDB via Spring Data

Introduction

In recent years, MongoDB has gained popularity as the preferred No-SQL database for application developers. To get started, today I will show you how to connect to MongoDB using Spring Data for various kind of Maven Java Projects including how to connect to MongoDB Atlas. 
 

Thursday 19 September 2019

CRUD API For MongoDB using GoLang

Introduction

While MongoDB has established itself as a preferred NoSQL database in last few years, Go language or in short Go, developed and backed by Google has gone up the ladder of popularity as a mainstay programming language during the same period almost. Being a beginner to both the worlds, today I will show you how to develop API for MongoDB CRUD operations using Go and official MongoDB Go driver.

Following are the things that our API achieves.
1. It reads a JSON object to add a document in a MongoDB collection.
2. It reads a document from MongoDB collection and display in JSON format.
3. It updates a document in a MongoDB collection.
4. It deletes a document from MongoDB collection. 

Thursday 22 December 2016

Flying Wild with EJB 3

Intro to WildFly

Last time I had worked with JBoss, 2 to 3 yrs back, it was JBoss 7. Recently I got a chance to work with JBoss for some EJB stuff. But to my curiosity, it is no more JBoss now. Rather it has got an incarnation in the form of WildFly. While writing this blog, WildFly 10.1 is the latest release. 

So today I will show you how to write and run EJB 3 program in Eclipse using WildFly server.

Friday 16 October 2015

RESTing In Spring

What is REST?

REpresentational State Transfer or REST, in short, is a kind of web service that deals with transfer of state of resources from one application to another. REST resources can be represented in various forms like JSON, XML, HTML etc. This is one of the few reasons REST has gained popularity in recent years over its traditional sibling, SOAP. While SOAP is heavy weight, action based, REST is lightweight, resource based.

Spring, being one of the popular frameworks, supports REST i.e., we can develop RESTful web services using Spring. Here I will show you following two things:

1. How to create a REST Service using Spring?
2. How to write a REST client using Spring?

Wednesday 24 December 2014

Partitioning In Spring Batch

Introduction

As in a batch job huge no of records are processed, it faces performance bottlenecks sooner than later. Different performance bottlenecks that can be cited during batch job execution are long execution period, OutOfMemoryError, bad records which abort the job immediately etc. So while writing a real-time batch job, we have to be utmost careful and take these parameters into consideration. That will help us scale up the batch job properly.

Though there are various ways to scale up a batch job, here I shall show you how to scale up a Spring Batch job using local partitioning. Partitioning is a mechanism of dividing a step into multiple threads where each thread executes a chunk of data in parallel. Here original step is called Master while steps that execute through threads are called Slaves. Some programmers refer to it as Master-Slave approach. Again partitioning can be of two types, local and remote. Remote partitioning is beyond the scope of today's discussion.