From the category archives:

Cloud Computing

Since the introduction of the NoSQL database model to the world, there’s been a flurry of proponents and detractors that seem to fall into a 50-50 distribution. Some of the discussions have become very heated, others are just laugh out funny.

One of the things that have been talked about in the blogosphere is that you shouldn’t embrace NoSQL as the first solution to your problem. There is time — they say — to scale it using NoSQL later on. To me that makes no sense: NoSQL engines have become mature technologies that can be used by any enterprise, big or small.

Reddit user cogman10 mentions on this blog post:

Picking Tech A over Tech B is NOT a premature optimization. Would the author claim that “Using InnoDB is a premature optimization because MySQL is better supported!” It is called planning, you do that whenever you write a new application.

Use the database that best matches your data. If some non-relational database is a perfect match for the data you want to store, by all means use it. Don’t give two shits about people like the author that think SQL is the one and only query language. (hell, I wish that SQL would die in flames, but it is heavily built into current business models. Not because it is the best, but because it is common.)

Insisting on the wrong tech is not premature optimization. It is stupidity.

But in some cases, there might be a mixed option available: using both SQL and NoSQL.

High Write / Low Reads

Writes are expensive on SQL engines. This is because, unless you use sharding, you usually write on a Master Server. But sharding (in effect writing to multiple “masters”) makes your solution to not be ACID — “Atomic, Consistent, Isolated, Durable transactions” — anymore (i.e. a write on master 1 might no be available for some time on master 2).

This is where NoSQL shines: writes can happen on any box and even though they’re BASE – ”Basically Available, Soft State, and Eventually Consistent” — the “eventually” piece is usually really fast.

The Mixed Approach

If you have relational model that you would like to still use, you could potentially leave the read data on a SQL engine (being careful to avoid super complex joins, which are also very expensive in terms of load) and then host the write-heavy tables on a NoSQL engine.

Why not code everything using NoSQL from the start? Because there are benefits to using SQL, like joins and or other features that you might not want to give up. You could also potentially need to write much more code to adopt the different data approach that NoSQL requires.

Take a look at the diagram below (click to enlarge):

As you can see on the diagram, we have web users coming into a load-balanced cluster of web server instances that have connections to both MongoDB server instances (NoSQL) and a connection to a MySQL slave server instance on a cloud environment. This part of the network can grow or shrink horizontally very easily, by adding web servers, mongo servers or MySQL slave servers. I would probably group up to four web servers per MySQL slave, and then create a new MySQL slave instance for every new group of four.

The MySQL Master lives in a physical colocation environment and there are processes running there that update the relational data.

Let’s see an example. Say you have a heavily visited shopping website where you need to have complex product information that contains many joins (product to manufacturer to inventory levels; that would be the SQL piece), but you need to track the product pages people are visiting, sort of a log of their activity. You could have this high-write activity happening on the MongoDB NoSQL servers. And because they will actively be written in the sharded MongoDB servers they will be scalable.

As traffic grows, you can add more MongoDB servers and the load will be distributed properly. The product information might change once per day or some other low frequency schedule, which makes it perfect to have on a read environment. Remember, reads are cheap.

If you need data from the MongoDB servers from your colocation environment, you could potentially run cron-based jobs that download the data from the MongoDB servers securely in a scheduled form.

You could also potentially put a load balancer on front of multiple MySQL Slaves, if you wanted a quickly scaling setup.

The main point I’m trying to make is the following — use the right data solution to your problem. SQL, NoSQL or both. Don’t be fixated on the technology, but on what you need to accomplish.

{ 0 comments }

The Keys to the Cloud Are Inside Smart Caching

June 14, 2011

There is a strong wind blowing the Cloud space these days, and we are about to be part of a great shift in computing. Web apps seem to be the next logical frontier to be reached, where URLs will be a thing of the past. ReadWriteWeb wrote the following about the new version of Google [...]

Read the full article →

Rackspace Cloud vs. Amazon Cloud — Which is the Winner?

April 15, 2011

I’ve been an EC2 customer for 3 years now, and have been using Rackspace for the past 3 months. But I’ve been reading or hearing this question for what feels like an eternity: Which one is better, Rackspace Cloud Servers or Amazon EC2? To add fuel to the fire, Dave Winer recently posted an article [...]

Read the full article →

FTP Upgrading of WordPress on AWS Instances

July 4, 2010

For months I was annoyed at the inability of my WordPress installation to automatically upgrade both plugins as well as the core installation. Every time I had to do a core upgrade of WordPress, I would manually download the zip file, unpack, copy the wp-contents and wp-config files and then take care of any outdated [...]

Read the full article →

Microsoft Azure is The New Outlook

November 17, 2009

I just received an email invitation to try out a new application. I get a lot of those these days, but this one was different.

It was from Microsoft.

It picked my interest. A Web Platform Installer? Microsoft doing PHP?

I went to the URL provided and I was blown away with the concept behind this application. Basically Windows has introduced point-and-click cloud computing for the masses and it’s doing it in a way that resembles the iPhone application directory but for web applications.

I hate to say it but it’s brilliant.

Read the full article →

AWS Import Tip: Don’t Do It On Windows

November 16, 2009

I just spent the last ten days trying to do an import on Amazon S3 using their Import/Export service. Basically Import/Export allows you to send a drive to Amazon via snail mail and they will hook the drive to their system and import the data locally. It’s much faster than trying to upload the first [...]

Read the full article →

It Sucks to be T-Mobile in the Sidekick Fiasco

October 12, 2009
Thumbnail image for It Sucks to be T-Mobile in the Sidekick Fiasco

The worst situation any provider can face is a huge data loss that happens completely outside of its circle of influence. T-Mobile relied on Microsoft to keep the data integrity of its popular Sidekick cell phone. But when a major outage affected most of its users, it wasn’t Microsoft that had to deal with the [...]

Read the full article →

Trust the Cloud? Then Don’t Put Your Life On It!

August 10, 2009
Thumbnail image for Trust the Cloud? Then Don’t Put Your Life On It!

Do you have precious content on Google Docs or Flickr or some other cloud service?

Back it up locally. Now!

There’s a flurry of activity regarding the death of tr.im, a popular URL shortener service that wasn’t able to enter into a path of self sustainability.

The losers, as usual, are its users.

The fact is we’ve become too used to having reliable, free web applications. The truth is that these companies are, in most cases, launched first to see if they grab an audience, and then try to make a business model to continue sustaining their operations. Louis Gray has a great post about the cycles that these companies go through.

Please, learn this golden rule: if you are not paying for it, it might be gone tomorrow.

Read the full article →

Five Truths (or Lies) of Hosting in the Cloud

May 21, 2009
Thumbnail image for Five Truths (or Lies) of Hosting in the Cloud

Dave Winer put up a great guide on how to start a server in Amazon’s cloud a few weeks back. The article takes the user’s hand and step by step you go on to create your first server on the cloud. It’s a great accomplishment (I still remember the first time I did it) and you feel like you have become a member of an exclusive club.

However, once you see that “Hello world!” screen in there, many people ask, as Daniel Pritchett does in Winer’s post: “what do I put on my new cloud server?”

Read the full article →

Apple Has To (and Will) Have a Netbook

May 8, 2009
Thumbnail image for Apple Has To (and Will) Have a Netbook

On my Christmas vacation I carried a new friend with me that everyone was nuts about. What was it? What’s the brand? How much did it cost?

I had just bought a brand new MSI Wind on Amazon.com for a little less than $400 bucks.

Eight months later I can tell you that this machine has increased my work output by at least 10x. I carry it everywhere, I’m now writing a novel, two blogs and coding my next app while riding on the subway, I take it to the conference room and show power point presentations under my co-worker’s jealous glances, I surf the web while watching TV and my wife almost doesn’t mind it. Without knowing it, I had been waiting for a long time for something like this, and so were thousands of people.

The only thing, of course, is that it’s not an Apple — and I’m an Apple fan. I have an iPhone, an iMac and an iBook, and would have loved this next purchase to be an iTablet.

Read the full article →