Attending Adobe Max next week

As part of my job at Zend, I was invited by Adobe to Adobe Max in San Francisco - how cool is that? It’s a huge conference (thousands of participants - nothing like any PHP conference I know!) with so many presentations to sit in it’s just hard to choose.

Of course, I am no designer and tend to stick to the server side - so for me choosing was easier, but still confusing.

In any case if you are there, or in down town San Francisco, come and say hi!

ZendCon 2008 Slides

Well, ZendCon is over and it was much fun! I got home today (well, does 4:30 am count as “today” ?) and am still very tired - I had to stay around after the conference for some meetings (yes, the title “manager” causes some PITA even if you do not really manage anyone) which was a bit exhausting but fruitful never the less.

I gave this presentation about Zend Platform:

It’s the first time ever I’m giving a presentation about proprietary Zend technology in an open-source conference so I was a bit nervous - but to my surprise I got a full room (I estimate some ~100 people were there, and only a few Zenders) and there seemed to be a lot of interest. In general this ZendCon felt a bit more “business-oriented” than usual, but still had a good mix of community and hacker-spirit to it.

Another thing is that Siddhartha - our VP of Sales for North America actually HUGGED me after the talk. He was sitting in the room and the guy knows a lot about selling Zend Platform - but I suppose that hearing the value of the different features and some good example use cases for Zend Platform from a technical perspective gave him and the rest of the sales team some good insight into what customers are looking for in such a product.

Anyway enjoy the slides and if you have questions just post a comment. I will probably post some more about the previous week - if only I will be able to get my hands off my new iPod Touch ;)

Good old ‘includes/common.php’ is back!

In the last couple of days I’m writing a small demo-like database driven PHP app - you know, the kind where you show how to put records of something into the DB, take them out, list, edit, etc. - pretty simple stuff.

The catch is that this is to demo pure PHP - no frameworks of any kind. No complex design patterns or paradigms (such as MVC), no rewriting rules.

I must say I haven’t done this in a while. It feels good on one hand - remembering the power and simplicity of pure PHP. On the other hand it sucks ass - so many things (especially edge cases) you have to take care of yourself - things like execution flow, including that good old bootstrap file on the top of each script (yeah, each page in my app is a different script! remember those days?), manually taking care of layout and common HTML elements, validation - even manually writing so much SQL seems odd.

If you have some free hours this weekend, I suggest you try it - just to remember what it used to be like 5 years ago. It’s a good way to appreciate (or not) the framework or library you’re working with these days.

The PHP Hierarchy of Needs

We had a lecture about Unit Testing in our local PHP user group last week. I really like these meetings because there is usually good interaction between some very experienced developers and some very inexperienced ones.

Following the usual “but why is it better then just running it in my browser and seeing that it works” question made by one of the younglings, we got into a discussion of why Unit Testing it so good, and especially, why is it such an addictive practice and why people who do it (including myself) tend to love it so much.

And then it hit me: [more...]

New Server

Well, some 36 hours after I’ve switched the DNS records, it’s safe to say the bulk part of my blog’s server migration is complete. I’ve moved it from some shared hosting space I rent (which I will still use for some other things) to a dedicated server I share with some friends.

Obviously, this means much more power, and probably better performance - I can finally install Zend Platform on my own blog ;)

If you still encounter any issues (broken links, etc.) drop me a line.

Zend Framework Components Presentation @ DLW08

I’ve just finished my one hour talk at Dynamic Languages Europe titled “Zend Framework Components for Non-Framework Development”. Despite the long name, the presentation’s concept is quite simple: It’s an overview of some of the use-at-will, standalone components of ZF and how you can use them even in a non-ZF application.

The presentation went quite well and the room was full (and hot) - the fact that people actually stood throughout the presentation shows how popular ZF is nowdays (well, it was a small room - but still ;)

I didn’t have time to go through all the components I planned to (skipped Zend_Json and Zend_Log) but I still feel it was a good session.

You can download the slides here, or see it on Slideshare:

A small recommendation for those of you who present a lot: I used my newly-bought Logitech Cordless Presenter for the first time, and it really helped me. It doesn’t look so sexy (even for a shaver) but it has everything you need - remote control for the slides, laser pointer, timer to manage time (it will vibrate every 5 minutes if you want which I find very useful because I have hard time managing time when I present) and even a button to blank the screen. It connects through USB and is detected like any keyboard - so it worked perfectly with my Linux/OpenOffice and should work with Windows/MS Office and Mac (I suppose) as well.

Travel Plans

After what is probably the longest period of being at home without flying anywhere (since November!) in the last 3 years, I am actually quite excited to be flying again.

After a quick visit to Zend’s Cupertino office, I will be attending two conferences in may: I’ll be visiting the last couple of days (May 22nd - 23rd) of php|tek in Chicago - in which I will not be presenting, but will probably hang around with the Zend guys and go to some lectures.

After spending the weekend with friends in New York City, I’m flying to Germany to attend DLW Europe - a first-year conference dedicated to dynamic languages (PHP, Ruby, Python, Perl etc.). There’s quite a lot of known PHPers attending and speaking, and it looks like it’s going to be a blast. Personally I will be giving a talk I call “Non-framework Zend Framework Components” (working title) - which will showcase some of the more useful components of Zend Framework for those who do not want to base their entire application on it - but rather just need to preform tasks and want to reuse the high-quality components of ZF in order to do that.

So it looks like quite a road trip: Tel Aviv -> San Francisco -> Chicago -> New York -> Karlsruhe -> Tel Aviv - by the end of it I might be able to buy a MacBook Pro using frequent flyer miles only ;)

If you’re in either conferences - come over and say hi!

Playing with CouchDB View Collations

I've been playing with CouchDB quite a lot lately. While it's still far from feature-complete, I think it's a cool project. Generally the concept of object databases is a new thing to me, growing up in the web where for most people "database" == "Relational Database".

Since CouchDB related documentation is still scarce, I decided to share a cool thing I managed to pull around today with CouchDB's view API.

For the purpose of playing with CouchDB, I decided to write a PHP-implemented CouchDB interface (yes, I know there are exiting ones) I currently dub "Sopha" and a Wiki using CouchDB and Sopha as backend (if I ever get those to a stage where they would actually work, I will probably release them as open source).

One of the design goals of my Wiki, was that previous revisions of each page are kept and can be accessed. While CouchDB keeps track of object revisions, access to old revisions is not guarantees as those eventually get deleted - So I had to implement my own revision tracking of pages. The design I went for was simple: each revision in it's own document in the DB. They all have the same "title" field - but an incrementing revision number, starting from 1 (for new pages) and going up.

This design poses one major problem: how do you easily access the single most recent revision?

I started by creating 3 different view functions for accessing wiki pages: one to access the most recent revision of a page by it's title, one to access a specific revision of a page by title and revision number, and another one - to fetch all the revisions of a specific page by it's title.

This was a mistake, and it resulted from my years of thinking relational (keys, indexes, SQL, etc.). As I worked my way through, I started understanding the power and magic of CouchDB's views and view collations. With proper collation use, it turns out it only takes one view function to rule them all:

CODE:
  1. function(doc) {
  2.   if (doc.doctype == "WikiPage") {
  3.     map([doc.title, doc.revision], doc);
  4.   }
  5. }

Using this view function, I could do the following ("titlerev" is the name of my view function, URLs are decoded for readability):

Access the specific revision 123 of a specific page titled "My Page":
GET /database/_view/wikipage/titlerev?key=["My Page", 123]

Access all the revisions of "My Page":
GET /database/_view/wikipage/titlerev?startkey=["My Page"]&endkey=["My Page", "Z"]
This will work because CouchDB orders the results according to their key - and has strictly defined ordering rules - so ["My Page"] will always come before ["My Page", 1] and ["My Page", "Z"] will always be after ["My Page", n] as long as n is a number.

Access the latest revision of "My Page":
GET /database/_view/wikipage/titlerev?startkey=["My Page", "Z"]&endkey=["My Page", 0]&decending=true&count=1
This works as well - because records are selected in reverse order from ["My Page", "Z"] to ["My Page", 0] - but only the first one is returned - so it will always be the one with highest revision number.

How cool is that?

BTW there is a good article which also explains CouchDB view collations at cmlenz's (one of the contributors to CouchDB) blog.

New year, new position

I spent the last 2.5 years working for Zend's Global Services department, first as a technical support engineer and later as a technical consultant. I've learned allot and met lots of very smart people - but for some time now I have a feeling it's time to move on.

Apparently, some people at Zend had the same feeling - don't worry, I wasn't fired. I didn't quit either. Starting from January 2008, I am now a part of Zend's Product Management group.

My new and awesome title is "Senior PHP Specialist" which kind of means nothing (and that's what so good about it!). My actual roles are varied and flexible and involve duties such as competitive analysis, benchmarking, prototyping, meeting with customers and PHP community folks, and generally getting more customer and community feedback and touch into Zend's product line. I'll be working with all products - mostly Zend Platform, Zend Studio and Zend Core, and will also maintain my involvement in Zend Framework, and perhaps other projects as they come.

I have to say this has the potential of a dream job: it's hands-on, and yet very dynamic. It's community related and touches commercial products. It means working closely with services people, R&D, and customers (and PHP users who are not our customers!). It involves studying emerging technologies, programming, testing software, writing and reading papers and generally keeping a finger on the pulse of the web.

Oh, and did I say my new direct manager is Zeev Suraski?

So good luck and happy 2008!

Reducing your bandwidth for benchmarking purposes

In the last few days I've been busy doing allot of web application performance benchmarks. For some of these benchmarks, it was important to simulate a real end-user's average effective bandwidth (real-world download / upload speed from the end user's perspective).

Since we used a fast, clean LAN for our benchmarks (you can't get consistent numbers otherwise), we had to find a way to somehow limit the bandwidth of our LAN so that it would resemble "real Internet" throughputs. Since it took some research and reading to find the best way to do that, I've decided to write a quick HOWTO to describe what we've done.

[more...]