O’Reilly’s Open Source Convention (OSCON) in July of 2006 was a fun time for all who attended. One of the great things about it for me personally was that I was able to sit down with several influential members of the PHP community and talk to them one on one. Adam Trachtenberg was one of the one of the ones nice enough to sit down and talk to me.
Adam is the senior manager of Platform Evangelism at eBay. His job is to communicate to developers all the cool things possible with eBay’s web services. We sat for a half-hour to discuss PHP, eBay, where things are and where they are going. Here’s what he had to say.
Adam, I’d like to say thank you for taking time to talk with me today. First let’s get a little background. How did you come to be involved with PHP. Second, how did that lead you to eBay?
When I was in college, a group of friends and I started a website called student.net which eventually became student.com. This was in 1995 and we were just poor college students. We built it on a Windows platform but after Windows NT 3.51 kept crashing on us, we decided to look around and see what our other options were. Someone said, “Well, I’ve already got this Dell machine, why don’t we install this operating system called Linux? We’ll use Apache and we’ll do some Perl stuff and we’ll use mSQL.” mSQL was an open source database.
Over time, we found PHP 2 and we installed it and this new database called MySQL. We continued to use a lot of open source software on the site. All of a sudden, I looked around and someone had coined an acronym, L.A.M.P. [Ed. Linux, Apache, MySQL, PHP] for the technologies we were using. I realized at that point that a lot of people we using PHP. PHP3 was out, PHP4 was on its way and I had a lot of knowledge that I could share with others just because I was an early adopter. So I wrote a couple of books for O’Reilly, “PHP Cookbook” and more recently “Upgrading to PHP5″. While I was in the middle of writing “Upgrading to PHP 5″ and speaking at conferences like OSCON, sometime around 2004, I started looking for a job.
One of the topics I had been talking a lot about was web services and how people can use them. eBay, launched their web services in 2001, by 2004, they had windows code, .NET code and Java code but they began to realize that the open source community was important. I mean the whole point of web services was to be platform neutral. So eBay looked at me and they thought it would be a good fit for both of us because I had a lot of experience in open source and web services.
They also liked the fact that I had founded a startup, student.com. Since a lot of eBay’s development customers were startups – some one-man shops, some venture backed – they felt I was a good fit for what they need to grow their web services division. I was someone who could talk to developers using web services and open source technologies.
I actually found the job through a friend of a friend. I was doing some work on the SimpleXML extension, just bug reports and stuff for the book. I was on the IRC channel one day and someone said “Oh, you need a job, my friend needs some help.” So my resume got passed along to eBay and we both decided that it was a good fit so I moved out to California and I’ve been there a little over two years now.
The web services platform has really grown. We now have over thirty thousand members, over fourteen hundred live applications and last quarter, over fifty two percent of all listings on eBay.com came from a web services interface. About half of the calls made to eBay web services come from internal applications that we’ve written. The other half comes from third party applications written in all sorts of languages like PHP, Perl, python, VB, Cold fusion, Java, just about everything.
The great thing about eBay web services is that people can tap into the marketplace differently. Some want to be involved a lot and do all the research and list everything themselves; others just want to sell things and realize eBay is the best channel for them to do that but they don’t have the time or experience to handle everything themselves.
Give us an overview of the eBay web services API.
That’s hard to do. We actually open up almost the entire eBay platform through the web services API. They roughly break down into two or three types of activities. The one that was the first one released, the reason we opened up our API was the one we just talked about that helps resellers operate their businesses more efficiently. These resellers write what I call “Business Mashups” because they are mashing up eBay web services and maybe PayPal web services and the USPS or UPS web services to handle shipping. These eBay web services APIs allow a user to add items to eBay, check when they are sold, handle the feedback and generally automating all the process of listing items on eBay. From there we have many different things you can do of various complexities. We even have an API for talking a “best offer”. So if you list a large-ticket item like a car, you can list it for say, twenty thousand dollars but you someone offers you say nineteen thousand, five hundred. We have an API to help you accept or reject that offer.
In the last couple of years, we have been working closely with eBay affiliates. These are people who help drive traffic to eBay by serving up eBay content through value-added pages or buying ad words, or even incorporating eBay listings into their own content. One of the things we realized was that they could be more efficient if they we also using web services to do things like always pull the freshest item. We also help them with research by helping them find what’s most popular in the marketplace right now or what key words people are looking for. We now have a whole bunch of affiliates that use our searching web service as well as pulling items to help them find out what is happening on eBay. We’ve even recently rolled out an API that will help them by doing contextual analysis of web pages the help them figure out the right keywords to pull items for.
Then in the last year or so, we’ve seen the emergence of what we are calling “buyer tools”. These are tools to help buyers, buy more efficiently. That could be finding things on eBay or keeping track of what’s going on with items they are interested in. We’ve had a lot of developers working on tools now for the buyer. One really cool one is a service that will call you up on your phone and using IVR and let you know things like “the item you are bidding on is closing in 5 minutes and that you are not the winning bid.” With this service, you can even bid back through your phone. Another one we are working with, Scandex Software that integrates eBay completely with Microsoft Media Center. So you can be watching TV and an alert will popup on the TV notifying you about your bid.
What is your favorite API that you feel is underused?
One that news and people don’t use a lot yet is the “Get Popular Keywords”. We actually expose at the category or even sub-category level, what the keywords are that people are searching for. You can do that internationally because we expose our web services in more than fifteen different languages. So you can get, let say, the popular keywords in China for instance. Since it’s all in Unicode, you actually see the Chinese characters people are using. The API allows you to get a pulse for what people are searching for on. You can see what’s going on globally scale and how that differs on a region by region basis.
We just launched a new product called eBay express. eBay express is a way for people to quickly find what we call ‘Fixed price items’. eBay has always been known for our auction format which is the great differentiator for eBay but we also have a lot of items that are fixed price items. So we’ve released an interface optimized just for fixed price items. So you type in a product, for instance an iPod, it gives you a list of the items for sale at a fixed price.
Let’s switch topics for a bit here. You literally wrote the book on upgrading to PHP 5, what do find is the hardest thing for developers when migrating to PHP 5?
One thing I found from the feedback I got while writing the book was that a lot of developers need their software to run on both PHP4 and PHP5. When I was working at a company and we controlled our servers we had control over what version of PHP we were running so we could develop for PHP 5 if we wanted it. But I had people write me from projects like [Ed: but not specifically] phpMyAdmin or WordPress and say that they needed their software to work no matter what version of PHP their customers had. Since most ISPs run a version of PHP4, these big packages can’t afford to lock out their customer base. Since the changes between HPP4 and PHP5 are large, people are finding it difficult to write software that works with both simultaneously. That’s really the biggest barrier to adoption. It’s a “chicken and the egg” issue. If more software just went to 5 then more ISPs would also, or visa-versa. I do think that over time more and more will go to PHP5, it’s just going slow.
For hosts actually contemplating the move to PHP5, what do you find is the hardest part of the move?
There are only 2 things that are tricky and you really need to watch out for. First, if you are making extensive use of Object Oriented features in PHP4 there are things that are different. Things like the constructor of the class is now __construct() whereas it used to be a method named the same name as the class. But PHP5 does some fallback things to ease that along. Also “passed by reference” verses “passed by value”. In PHP4 we had to put a lot of ampersands together to get things passed by reference. If you are doing a lot of OO code then it’s something to look out for but if you are mainly working in procedural it’s not really an issue.
The other big issue that is tricky is that all the XML extensions in PHP5 have been re-written. They are much better and they have been standardized both within PHP but also they use a lot of the XML standards like DOM. Because PHP5 enabled us to do some things that PHP4 didn’t allow, they are also now more robust. If you are using the older XML extensions in PHP4, those extensions were not ported to PHP5. If you have code that relies on the old XSLT, the Sablatron library or the old DOMXML extension then you’ll have to fix your code to work with the new extensions. The book touches on this issue as well. It talks about the features that went away and the incompatibilities.
Those are really the main trouble spots for backwards incompatibility. There are some new features that you need to be aware of like mysqli and PDO if you are doing database work you can begin to use them. However, the old mysql extensions still work as well as the old Oracle extensions, so in that respect you can move to PHP5 and then chose to upgrade bits and pieces of your code.
Thanks for those tips. Now let’s look forward for a bit. What’s the next big thing for eBay that impacts the PHP community?
We are continuing to release new APIs. Since most of our APIs are SOAP, I have been working really hard to make sure that there are no incompatibilities with the new PHP5 SOAP extension. Using PHP5’s new SOAP extension makes working with our API really easy. Also, we now have a lot of APIs that do “eBay stuff”, we are now looking around to see if there are other services that eBay uses that we can expose to developers.
Interesting. Let’s talk about the future of PHP for a moment. What is the biggest thing that you feel PHP is missing?
Well I think that PHP6 addresses the biggest need and that’s Unicode support. Our web services use mainly XML and XML is Unicode friendly. So if you are using SOAP it supports Unicode. eBay is international and some of them do not support the use of standard western character sets, for example India or China. Therefore as applications are increasingly using web services and being global in nature, not having really strong support for Unicode is a serious limitation for PHP. That’s why I think it’s really great, the work that Andrei is doing with Unicode and PHP6. It will make it much easier for international developers to incorporate eBay’s APIs into their own applications.
Thank you for that. I agree Unicode is important and Andrei and the entire team working on Unicode are doing a great job. Let’s talk about technology in general now. What is the one new technology gets you excited?
Honestly, I don’t have time t play with new technologies that much these days. Clearly there have been a lot of talk recently about Ruby on Rails and how it lets you get applications up operating quickly. That’s been really quite interesting. One thing I’ve been really interested in recently has been XML databases. Normally, when you have data, you define the table sand relations and put your data in there. I call this square data because everything fits in a square table with columns and rows. As people are increasingly using XML both for web services on the backend and AJAX on the front-end you are really receiving XML as an input and sending XML to the client as an output. I call XML data angular data because all the brackets are angles. So why would you want to take angle data in, convert it to square data to store in the database and then convert it back to angle data when you send it back out to the browser? If you could store things as native XML then you could skip the whole conversion step.
What toys are you playing with in working with XML data?
I know there’s the Berkley database that has some XML support. I think MySQL actually is trying to bring out some new XML features. I know MarkLogic has XML support as well as some of the larger vendors as well.
There you have it. eBay is committed to building interfaces to just about any service it offers. They actively promote the use of their APIs to an ever increasing universe of developers. Most importantly, using their interfaces, you can build some cool functionality into your applications. Now if they would just release a Sniping API…hey, Adam, comeback!