I've been truly amazed for the last few weeks. Until recently, if you wanted to find me on the net, you looked for my nick on the IRC Hispano channels or in some obscure programming forum. On MySpace, people used names like "DarkSkater99" or "ChicaGoth_Madrid". Anonymity (or at least, pseudonymity) was the basic rule of survival on the Internet.

But suddenly, Facebook has arrived in Spain massively (well, and Tuenti, which is eating up ground in universities, but we'll talk about that platform another day) and everything has blown up. College classmates, people from high school I knew absolutely nothing about for years... And the craziest and most disturbing thing of all: they are using their real first and last names.

At what point did we all decide at once that it was a good idea to upload our civil identity, our real face photo, and say what company we work for in a public database over which we have no control?

The technical guts: The social graph and the collapse of databases

What really fascinates me about Facebook as a programmer is what they are building underneath. It's not a simple static page of user profiles. It is a gigantic relational database of human connections. They call it the "Social Graph".

Architecturally, as far as I've been able to investigate on American technical blogs, they are relying on a beast of a server farm with our classic LAMP stack (Linux, Apache, MySQL, and PHP). Yes, PHP. That same language that many Java programmers laugh at by the coffee machine is serving tens of millions of daily requests worldwide.

The technical problem here is that cross-referencing "who is friends with whom" data at this scale causes any database engine to collapse. A JOIN in MySQL to calculate the "News Feed" in real-time for millions of users would destroy the hard drives of any server. Their solution has been to tune MySQL to absurd limits, hardly use "hot" relational JOINs, and load the entire read layer into a massive distributed RAM cache system based on Memcached.

Furthermore, they have just opened a REST API and a rather alien markup language called FBML (Facebook Markup Language) so that any of us can program applications that run directly inside the Facebook ecosystem. I was playing around last night with curl from my Linux box's console to see how they spit out the data underneath, and it's quite clean and structured XML if you pass the correct token:

# Petición de prueba a la API REST de Facebook (versión 1.0)
curl -d "method=facebook.users.getInfo" \
     -d "api_key=TU_API_KEY" \
     -d "call_id=1210771200" \
     -d "v=1.0" \
     -d "uids=12345678" \
     -d "fields=first_name,last_name,pic,affiliations" \
     -d "sig=HASH_MD5_DE_LA_FIRMA" \
     http://api.facebook.com/restserver.php

What it returns to you is a wild block of data with the university where the guy studied, his last names, his interests, and his affiliation network. They are literally packaging our private lives into graph nodes and edges. And we are giving them this information for FREE.

The end of the Internet as we knew it?

All this movement generates mixed feelings in me. On the one hand, purely at the production engineering level, building a server architecture that scales to this level and allows rendering a user's activity wall by cross-referencing the events of hundreds of friends simultaneously seems like an absolutely brutal technical challenge. Hats off to Mark Zuckerberg's systems engineers.

But on the other hand, I wonder if we aren't making a colossal mistake as users. Until now, the golden rule was that what happened on the net, stayed on the net. If you said something silly on a forum at three in the morning, it stayed tied to an invented nick. Now, if you upload a drunk photo on a Saturday night (or worse, if someone "tags" you without your permission, which is another feature that scares me quite a bit), it stays permanently indexed to your digital ID and visible to your entire environment and beyond...

Maybe I'm just an old-school paranoid clinging to my lifelong forums, but voluntarily giving away our complete social graph to a private company in California seems like a dangerous sociological experiment. We'll see if this egocentric real-name fad withstands the test of time, or if in a couple of years we all sensibly go back to hiding behind pixelated avatars.