Mapping Relational Databases and SQL to MongoDB

NoSQL databases have emerged tremendously in the last few years owing to their less constrained structure, scalable schema design, and faster access compared to traditional relational databases (RDBMS/SQL). MongoDB is an open source document-oriented NoSQL database which stores data in the form of JSON-like objects. It has emerged as one of the leading databases due to its dynamic schema, high scalability, optimal query performance, faster indexing and an active user community.

If you are coming from an RDBMS/SQL background, understanding NoSQL and MongoDB concepts can be bit difficult while starting because both the technologies have very different manner of data representation. This article will drive you to understand how the RDBMS/SQL domain, its functionalities, terms and query language map to MongoDB database. By mapping, I mean that if we have a concept in RDBMS/SQL, we will see what its equivalent concept in MongoDB is.

We will start with mapping the basic relational concepts like table, row, column, etc and move to discuss indexing and joins. We will then look over the SQL queries and discuss their corresponding MongoDB database queries. The article assumes that you are aware of the basic relational database concepts and SQL, because throughout the article more stress will be laid on understanding how these concepts map in MongoDB. Let’s begin.

Read my full article here.

Social Network Style Posting with PHP, MongoDB and jQuery – part 2

[The article is originally written for SitePoint.com]

In the previous part of the series, we explained the database architecture, post stream design and application flow required for developing our post mechanism wherein the user will be able to post a status, like/unlike other people’s statuses and comment on them. This part of the series will drive you through the coding required to implement these functionalities. We will use the application flow and database structure as discussed in the last article. Don’t forget to download the code from the github repo if you’d like to follow along.

Read my full article here.

Social Network Style Posting with PHP, MongoDB and jQuery – part 1

[The article is originally written for SitePoint.com by Ashish Trivedi]

Post mechanisms similar to Facebook are nowadays very common within any application. The concept of Post-Like-Comment is familiar to everyone who ever used a social network. In this article, we will learn how to create a similar working model wherein the user will be able to post his status, like posts and comment on them. What’s more interesting is that after learning things from this article, going forward you will be able to implement a lot of other features on your own.

I’ll be using PHP as the coding language, MongoDB as the database and jQuery for JavaScript operations. It is assumed the reader is familiar with the basics of PHP and MongoDB to understand the article thoroughly. However, note that the article is written in a very generic and newbie-friendly manner and there is a lot to learn from it. So, even if you are not using Mongo DB or jQuery, you can easily adapt to or replace those technologies with those you prefer.

Read my full article here.

Rockmongo for PHP-Powered MongoDB Administration

By default, MongoDB provides the interactive JavaScript-based mongo shell which can be used for performing database operations. Although this shell may be the best approach to start with MongoDB queries, a GUI tool to administer the service is always useful.

There are many such GUI tools available, like Rockmongo, PHPMoAdmin, Fang of Mango, UMongo, MongoExplorer, and MongoVUE, to name just a few. When it comes to using MongoDB with PHP-based projects, Rockmongo and PHPMoAdmin are good options. In this article, we’ll take a look at Rockmongo.

Rockmongo is an open source MongoDB administration tool written in PHP5. You’ll become familiar with using Rockmongo to create databases, collections and documents, query collections, and import and export data. Ready?

Read my full article here.

 

5 Things to Learn From a Failed Startup

[The article is originally written for NextBigWhat.com by Ashish Trivedi]

The tremendous wave of startups in India is on. A lot of these startups are early stage startups by fresh students or recent graduates. Although we have seen a lot of such startups turning big later, sadly the success ratio of such startups is too low. A lot of them fail in the very first year of their journey. You call it lack of experience, market strategies, funds marketresearch.

try_fail_thumb.jpg

In this blog, I would like to share similar experience with my first startup. The startup rose to become a famous talk in the initial stage but eventually had to shut down after some time due to some reasons. Though the startup failed, it gave me lot of insights and experiences into this field, which drives what I do today. Below is a compiled generic checklist for any such startup to keep in mind:

Read my full article here.

Modeling Data Relationships in MongoDB

[The article is originally written for PHPMaster.com by Ashish Trivedi]

It’s important to consider the data needs of your application right from the very start of development. But if your app will be using NoSQL and you come from a RDBMS/SQL background, then you might think looking at data in terms of NoSQL might be difficult. This article will help you by showing you how some of the basic data modeling concepts apply in the realm of NoSQL.

I’ll be using MongoDB for our discussion as it is one of the leading open-source NoSQL databases due to its simplicity, performance, scalability, and active user base. Of course the article assumes that you are aware of basic MongoDB concepts (like collections and documents). If not, I suggest you read some of the previous articles here at PHPMaster to get started with MongoDB.

Read my full article here.

MongoDB Indexing, Part 2

[The article is originally written for PHPMaster.com by Ashish Trivedi]

In part 1 of this series we had an introduction to indexing in MongoDB. we saw how to create, use, and analyze queries with indexes giving us a good foundation to build on. In this part, we’ll take a look at a few more small but important concepts, like indexing on sub-documents and embedded fields, covered queries, and index direction.

Read my full article here.