Archive for April 2008

Free software revolution and a modern artist

What made Marie Digby? I’ve heard about her on the radio from time to time, while I do the unnatural act of driving somewhere. Now, I’ve been invited to an event, where the tagline says that she’s “a star born from YouTube”. I had to dig further.

Decided to watch the famous video. Its just her, sitting with her guitar, performing an acoustic version of Rihana’s Umbrella. Nothing fancy. I’m told she sat in front of her MacBook to make the “hit”.

Grassroots marketing? Bands try much harder, and still feel the pain of becoming somewhat famous. What makes her different? Beauty (she’s of Japanese-American heritage)? Sultry look?

I wonder what her tipping point was. She’s had it easy, when you think about it. The Internet has popularised so many good things, and even if you rewind back say fifteen years ago, there is no way an artist would have made it easily, via grassroots events/stunts.

Aren’t you glad you’re part of the free software revolution? If not for Linux (SuSE), Python, MySQL, and lots and lots of disk, you will not be seeing Marie Digby, now will you? And naturally, if not for the ease-of-use of her Apple laptop, and how they’ve become commodity hardware (15 years ago, there were for “graphics professionals” and were sordidly expensive). Times do change.

Maybe I’ll go to the event… if I’m not too jet-lagged (imagine, planning a month in advance to be jet-lagged)…

Technorati Tags: , , , , , , , , , ,

Notes from conference on Wiki

Its worth noting that all talks that have been blogged are being linked on the Forge Wiki. Take a look at Notes from the conference. There are some great entries there, and when the slides become live on the website (today, I believe), you can gather heaps of information, if you missed the most successful MySQL Conference & Expo. Book early for next year.

Thank you bloggers!

Technorati Tags: , , , , , ,

What MySQL Can Learn from PostgreSQL

Hi! So this is completely my notes taken from the conference, without my thoughts attached to it. I should definitely post a lot more about this, and how the community can “improve” in time. Just not today. Believe me, sitting in the talk, was highly painful, and I’m wondering where my aspirin stash might be. The slides will be available soon, and lets just consider this a learning experience. It reminded me of the time Eric Raymond came to the Fedora Project’s very first FUDCon in Boston 2005 (probably the only session without available video :P).

What MySQL can learn from PostgreSQL
Joshua Drake
(more…)

Who is the Dick on my site?

Who is the Dick on my site?
Dick Hardt

Most interesting keynote. About 1,000+ slides. Many slides per minute. Definitely a new way of presenting :)

  • What is identity? What is Identity 2.0?
  • Identity is a complicated topic, and you normally get the tip of the iceberg. Identity changes during your stages in life.
  • Works at SXIP Identity.
  • I wondered what the German’s thought about identity. Identat. “They’re German” <applause>
  • Answers.com had the best answers for identity.
  • There’s lots of different personas about a person. Women really are the masters of different personas (clothes, wife, mother, etc.). Reinventing oneself.
  • Identity allows you to predict behaviour…
  • When someone is in a “role” (fireman, etc.), you think you can predict behaviour. Is this identity? It’s who you are, not really, no.
  • blame.ca (his website)
  • Identity transactions… on where is identity used? Party identification, authorisation, profile exchange (information about a person so you know them better).
  • “Do you want to present ID at a bottle shop? If no, you can rollback the transaction!” <applause>
  • Photo ID is a reusable credential. This is an identity transaction.
  • Reputation built up on eBay? You can’t take it over to Craigslist. Identity 1.0 is site centric, its a walled garden.
  • identity20.com
  • Facebook is becoming a new silo. URIs enable things to be open (LinkedIn, Twitter, Flickr, etc.)
  • DataPortability.org – user centric
  • Kim Cameron – Laws of Identity (read it)
  • Device convergence – near field communication, phones doing more than make calls, etc.
  • Digital natives and immigrants. What are you? CNN == news source for natives, immigrants tend to use newspapers. I wouldn’t use CNN as an example myself, but the drift is there. Digital camera (immigrant) vs. just a “camera” (native). The younger generation are all digital natives…
  • OAuth spec – take a gander at this…
  • Reputation services: blogosphere (“pagerank”), open source contributions, wiki, “human” (so stop typing captchas!)
  • Viagra. You’re excited to take it. You can do new things!
  • myhealth.sg was mentioned. Singapore on the forefront of Identity 2.0 and OpenID? Or is it CardSpace (Microsoft) related?
  • What happens when you die? Your domain can be taken by someone else. Do they then become you, if that was your OpenID? Very interesting thought.
  • He flies Air Canada, and loves to talk about his Star Alliance Gold status :) Jives well with me, I’m Star Alliance Gold.

Technorati Tags: , , , , , , , , ,

Help, my website has been hacked! Now What?

Eli White from Digg presented. It was an interesting talk… He covered:

You are going to get hacked…
– SQL injection
– XSS
– CSRF (cross site request forgery)
– Session Hijacking

Slides (PDF, ODP) have SQL injection/XSS example, with the hole, the attack, and the prevention.

Technorati Tags: , , , , , , , , , , ,

Services Oriented Architecture with PHP and MySQL

Joe Stump, Lead Architect, Digg. Slides should make its way at Joe’s website soon enough.

Mainly works on the backend, makes sure its scalable, can all the Digg buttons be served, et al.

Application layer is loosely coupled from your data. Whole point of SOA? You can put a service in front of the DB, and move between DB’s if required.

They do use MySQL, but its pretty vanilla.

Old habits die hard
– Data requests are sequential (I need foo, bar, bleh, ecky)
– Data requests are blocking (When you need foo, nothing else is happening)
– Tightly coupled (mysql_query, and if you’re using DB abstraction layer even, you’re still using SQL… you then can’t use CouchDB for instance)
– Scaling is not abstracted (a lot of caching are in the front end code. Its a problem when you start scaling your teams out). They use memcached from what I gather.

SOA
– Data is requested from a service (via HTTP, custom, etc.)
– Data requests are run in parallel (over non-blocking sockets. 10 data requests in 1 webpage, and each request takes 10ms. It might now only take 70ms now, maybe, over 100ms. Generally 1.5-2.5x faster now, for blocking parallel requests)
– Data requests are asynchronous (non-blocking parallel requests)
– Data layer is loosely coupled
– Scalability is abstracted (can find engineers anywhere, that can parse JSON or XML :P)

Options?
– Run requests over HTTP (Google (Java), Amazon (Java), etc.)
– New York Times’ DBSlayer (small little HTTP server that runs and provides parallel and async requests to mysql)
– Danga’s Gearman (binary protocol, has worked, its kind of a queuing system)
– Remember the wall clock goes down, but the CPU time is still happening, its still the same

HTTP w/PHP
1. Group requests for data at the top
2. Open a socket for each request
– Sockets must be non-blocking
– Make sure to use TCP_NODELAY
3. Use __get() to block for results
4. See Services_Digg_Request

Use a pear package, called Services_Digg for the above example. Note Digg’s API documentation as well.

HTTP is widely supported in all languages. Its very easy to get up and running, with lots of options for servers/tuning. Overhead in the protocol is great, and Apache itself has a lot of overhead.

DBSlayer
– small HTTP daemon written in C. You post JSON to it for communications
– connection pooling (benchmark mysql connection, and there’s a whole bunch of overhead in the mysql authentication; mysql proxy does this too)
– load balancing and failover (like mysql proxy)
– tightly coupled to MySQL (no migration)
– tightly coupled to SQL (no CouchDB)
– no intelligence

Gearman
– highly scalable queuing system (worker bees, like PHP scripts. Sockets open, client comes to gearman server to do foo, and it says it has n number of workers, and gearman gets ’em to work. So it works linearly. Jobs can return results back, run in parallel on many gearman servers and many CPUs)
– simple and efficient binary protocol
– sets of jobs are run in parallel
– queue can scale linearly
– php, perl, python, ruby, c clients
– poorly documented (“I think poorly documented is giving them too much credit.. All danga stuff has next to no documentation”)
– livejournal uses this, instead of using HTTP running
– its not very “robust” (it scales, they at digg don’t see massive number of failing jobs. Queue isn’t persistent though. When pushing stuff, and gearman gets restarted, the queue goes away – there is a workaround, for this, so ask Joe – its an undocumented feature available though)
– digg uses it in the submission process for crawling
– Chris at Yahoo! uses Gearman requests to run multiple memcached GETs (if you’re not using multi-get, check them).
– Check out Net_Gearman, which is a PEAR package

DIY option?
– not recommended, unless you have a highly customised solution, i.e. what Flickr does
– they ran into a problem where uploading an image, and then getting the image resized, for large images, was a problem. So they use a custom binary protocol that is much more efficient for the datasets (think, an SLR has files that are 7MB in size or something)
– this requires more resources (humans, engineers!)

What goes in the Services layer?
– smart caching strategies
– data mapping and distribution
– intelligent grouping of data results
– partitioning logic

Remember to intelligently group data into endpoints, and version them! This will help you improve your software.

Consider bundling and grouping requests (bulk loading).

EPIC FAIL!
– sending SQL over for translation? Pfft. DBSlayer does this, but it tightly couples you
– hundreds of teeny tiny endpoints (cohesive endpoints that return a decent amount of data)
– running SOA requests sequentially! You then get no benefits from an SOA architecture, at all. Parallel requests are good.

Technorati Tags: , , , , , , , , , , , , , , , , , ,


i