Heartbleed – What went wrong ?

I am sure that by this time all of us have already heard about the Heartbleed ,that made almost every encrypted sensitive data i.e passwords,credit card details etc vulnerable to external attacks.

Background :
These days almost each and every website asks user for registration and provides them with an username and password for there future interaction with the website.Today HTTPS protocol is the defacto standard for sending the sensitive data to the server and behind the scenes Secure Sockets Layer (SSL) and Transport Layer Security(TLS) protocols which make sure that every transaction between the client and server is secure. Continue reading

Logical Querying MongoDB Java Example

This post will focus on the logical Logical Querying MongoDB Java Example
operators that are available in
momgodb.I will use Java for the
illustration purpose of these
operators. You can use any of
the language for which mongo
driver is available. For the comparison operators you can refer the previous post here.
There are 4 logical operators that have been documented in mongodb specs.
We will continue with the same example that we have seen in the previous post. Continue reading

Conditional Querying MongoDB Java Example

In the previous post we have seen  Conditional Querying MongoDB Java Example
different variations of find() method ,
but in real life we need much more than the exact matching  e.g we want to query  in ranges (using in ) , combine multiple conditions together (using OR , AND)  , using negation etc. In this post we will cover the comparison query operators that comes under the conditional querying in MongoDB :

Here, we will continue with the same example that we have used in the previous post , in Continue reading

Metaspace in Java8

Metaspace in Java8One of the new features that we will see in Java8 is the introduction of Metaspace. Metaspace is nothing but a replacement of our old friend PermGen (Permanent Generation) space.

What is PermGen?
The permanent Generation is part of your heap space that is actually used to store meta-data information for the classes created by users and prior to Java 7, it is also used to store interned Strings (interned strings – used to remove String duplicates by internalizing them to reduce memory consumption). As of Java 7, intern strings also moved as a part of heap space to make the more space available in Continue reading

Querying MongoDB Java Example

In the earlier post Mongodb java Hello World Example we have seen some basic operations on the MongoDB and searching the document was one of them there we had used find().In this post we will more focus on querying mongdb with java using find() method that is basically used for querying documents in mongodb collections. We will see that how we can use find() in different ways to meet our query needs.Below are the 4 basic scenarios that we are going to cover under querying mongodb java example.

  1. Fetching all the documents from a collection.
  2. Fetching a subset of documents from a collection.
  3. Fetching only selected keys of a document from a collection.
  4. Exclude some keys of a document from a collection.

Querying MongoDB with Java

For this example the document that we are using will have structure something like this , it has Continue reading

Microsoft Bing Search and Earn Program

While searching something on the MongoDB over the internet somehow  (yes you heard it right :) , a google fan) i selected Bing search engine in the mozilla search tool bar and next thing that i saw on my search results page is the message from the Microsoft that you have earned 1 credit. Initially I ignored it and i changed my search criteria because earlier one was not giving me the result i was looking for , this time i observed that those credit becomes 2.
search and earn with Bing
Now it increased my curiosity and i thought it might be the same thing like what stackoverflow offers but there they call it reputation (and it matters). So, i thought microsoft also started Continue reading

Remove() Vs Drop() in MongoDB

Once we have documents stored in our collection , we can remove all of the documents from it in two ways. Now choosing one over other is totally depends on your requirement.

  • Using remove()
  • Using drop()

This post will show a comparison on Remove() Vs Drop() in MongoDB.

remove() vs drop() in mongodb

Before using one of them lets try to look into the pros and cons of each other.

  1. Using Remove():  remove has two overloaded versions ,one in which we will pass the Continue reading

MongoDB Java Hello World Example

In the previous post  we have seen some of the basics on the primary keys and ObjectId in MongoDB.Now its time to get our hands dirty with some code , here I am using Java to interact with our mongo database. In this MongoDB Java Hello World example we will cover the following points : -

MongoDB Java Hello World Example

MongoDB Java Hello World Example

  1. Connect to mongodb server
  2. Connect to a database / Create a new Database
  3. Create a new collection
  4. Insert a new Document
  5. Search a Document
  6. Update a Document
  7. Delete a Document Continue reading

_id and ObjectId in MongoDB

MongoDB has its own style of storing the  documents in the collection and providing the uniqueness to these documents is an important aspect of MongoDB.
So , it is very important that before we go into the higher end of Mongo we should understand what are _id and ObjectId in MongoDB.

_id and ObjectIds in MongoDB-1

MongoDB Official Logo

In relational databases like Oracle , DB2,MySQL etc whenever we insert any row into the database of our application we never care about providing the Continue reading

Create Favicon for WordPress Blog

Favicon :

Create Favicon for WordPress Blog

It is a 16X16 (pixels) short image that actually used to give the first impression about your website/blog ( a pictorial representation) . In simple terms it basically cuts long story to short.Whenever you  use any tabbed browser like Mozilla  ,Chrome etc you will see a small icon on the left of your tab , that small icon is nothing but your favicon. Moreover , you will see the same favicon in the bookmarks tab also when you bookmark any page. Sometimes these favicons are very useful in finding the website that you are looking for , from a big list of bookmarks that you have in your browser. If you see in the above image , that green color square is the favicon for this blog. Continue reading