Skip to content

Month: August 2010

Moving from SQL to NoSQL

Are you thinking on moving your database from a SQL implementation to a NoSQL one ?

Sometimes when you decide to move to a different approach lots of doubts pop out of your mind, there are a couple of actions that can make your decision more solid and secure. I’ll try to provide some tips that would help you to choose the right NoSQL implementation.

When do you need to think about NoSQL ?

Often web application start by being implemented on top of MySQL, the one day your application got traction and performance issues start to be a real pain due to high load of read/write queries on your system.

At this point you have 2 choices:

  1. “Shard” your data to partition it across several sites
  2. Go for a licensed SQL DBMS or move to  a NoSQL DBMS

Basically, you need to scale with less amount of money spent possible. Michael Stonebraker written a good article on this.

Making PHP Connection handling work for you

Recently i had a challenge where i needed to return a hyper fast response with data to the user (browser), although due to the number of operations needed to perform on database that was just not possible. So, i did some research, and remembered a technique that Bruno Pedro pointed out awhile ago.

If you play a little bit with Php and http headers you will make possible to:

  1. Return data to the browser
  2. Detach http server process from client (browser)
  3. Keep script execution running

The solution is actually quite simple, if you refer to PHP Manual – Connection handling section, you will find a lot of examples on how to do this.