Archive for February, 2009

Dear IT Leadership: Please Lead - February 25, 2009 at 12:03 pm

Follow Reid Carlberg on Twitter or contact him at rcarlberg@modelmetrics.com.

Dear IT Leadership,

Today, your business needs you more than ever.  The economy is weakening.  Competition is intense.. You’ve helped it navigate technologies for years.  But the business has immensely complex new challenges today.  It needs your help to operate more efficiently.  It needs your help to innovate in new ways.

In short – they need you to lead – but they need you to lead differently. 

They need you to lead them through radical change. 

What do I mean?

Have the wisdom to divide the marketing hype and the FUD from the real story behind cloud computing and utility computing.  Despite their catchy names, Larry Ellison’s protestations, and the high-energy sales effort you’ll run into, these are real, they’re here to stay and they make a substantial difference.  Your competitors know how to exploit them.  Your business needs to, too.  This is your responsibility.

Have the courage to rely less on the technologies that have served you well so far.  Oracle. Microsoft. SAP.  As painful as it is to admit, they aren’t keeping up.  And they won’t do anything interesting in this department until enough of you, their soon-to-be-former-customers, leave them.  There’s every likelihood they won’t do it then.  And some of your old-line competitors will ignore my plea and do the same: nothing.  This is your opportunity.

Have the strength to pull your team through the keyhole of this new paradigm.  They’ll feel threatened because their old skills aren’t as useful as they once were.  They’ll be scared for their jobs. But they’re closest to the problem and the ones who can best help you take the next step.  Change is hard.  Not everyone will make it.  But you’ll need those who can make the switch for the very real, high value add work of transforming your company.  This is your challenge.

Have the generosity to share what you know about technological success with the newest drivers of technical innovation in your company – business owners.  Cloud computing and utility computing both reduce or eliminate barriers to technology driven innovation, but they don’t eliminate the need for things like validation and requirements gathering.  They help technology become more egalitarian, but  neither cloud computing nor utility computing know your business.  Think disintermediation.  Think empowerment.  Think coaching.  This is your reinvention.

Have the energy
to jump in with both feet.  Have the patience to put up with some bumps in the road.  Clouds are built on solid technology and maturing quickly, but they’re still relatively young.  A blip here or there doesn’t mean the sky is falling.  Moreover, your efforts to transform the technical backbone of your enterprise will span multiple generations of cloud and utility computing, including future significant transformation that no one even thinks is possible yet.  This ongoing radical change – this is your chosen profession.

Take the next step. 

Build your next web application on the Salesforce.com Force.com platform.  Start with a free developer account.  Do it in secret and only show someone when it’s done.

Move a server to Amazon Web Services’ Elastic Computing Cloud (EC2).  Start with the very next small project that someone wants to do but you’re worried is going to cost too much.  Publish the price difference to the rest of the business.

Do a cost comparison between what you’ve spent on Exchange and what your email would cost to run on Google Apps.  Now do that same comparison adding together your total email spend with your total Microsoft Office licensing cost.  Google Apps can replace some of it.  Launch a pilot.

Do it on your own or with help.  Do it because your business demands it.  Do it because you’re scared your competition is out innovating you.  Do it because you’re tired of worrying about backups and whether or a not a server is running.  Do it to grow the value your business delivers without growing headcount.

Whatever the reason, do it.  Do it today.
 

Four Reasons I Don’t Care That Gmail Went Down - February 24, 2009 at 4:43 am

Follow ReidCarlberg on Twitter or contact him at rcarlberg@modelmetrics.com.

Hey Stumbleupon — welcome!  You might also enjoy "Import Your App from Excel".

Gmail experienced an outage in Europe overnight.  There’s some handwringing and frustration about it.  But you know what? I don’t care.  Here’s why.

1. The last significant Gmail outage looks to have been in August.  Four months ago.  My old email provider, which cost about $25,000 more per year than our enterprise Google account (which includes a whole lot more), used to “have some issues” (as we put it) about once every four weeks. 

2. Google’s Gmail ops team is working on this.   Correct that – they worked on it and it’s already fixed.  I didn’t have to do anything.  I didn’t have to submit a ticket.  I didn’t have to call.  I didn’t have wonder if anyone else was having the problem.  It’s fixed.

3. No matter what the problem was, I’m not going to have to go out and buy a new server or install a patch.  I’m not going to have to do anything other than wait a few minutes and try again.  Awesome.

4. No matter what the problem was, I’ll bet you $100 I didn’t lose any data and that you didn’t either.  The sum total cost of the problem was inconvenience.  Although that can feel significant, it’s so much better than incurring substantial actual real dollar costs.

So that’s it.  Gmail is back up and all that’s left to do is complain.  But I’m going to ignore the complainers on this one.  This is definitely no big deal.

 

 

Top Five and One Half Amazon Web Services Factoids I Learned in Seattle - February 21, 2009 at 7:18 am

You can follow Reid Carlberg on Twitter or email him at rcarlberg@modelmetrics.com

We’ve used Amazon Web Services in my department, but I wasn’t very close to the project.  So when I had a chance to take a deeper dive, I jumped at it.  Here are some of the things I learned.

1. AWS Dropped prices on their SimpleDB service by 83% on December 1, 2008.  Holy. Moly. Talk about a great illustration of the difference between storing stuff in the cloud and doing it yourself.  And there’s a fair chance you’ll be able to use it for free.

2. One government agency was looking to do a proof of concept on a project.  If they would have bought computers, they would have had to spend about $30,000.  They couldn’t get approval so one of the people involved launched it on AWS’s EC2 service.  Total cost?  $5.  You read that right.  Five dollars.

3. Animoto, the coolest photo to video site on the web, scaled from about 40 servers to almost 5000 in three days.  40 to 5000.  Wow!  If they were handling their servers any other way, they wouldn’t have been able to do that.

4. All kinds of organizations are doing interesting things on AWS.  From the New York Times to Harvard Medical School to ….  you name ‘em, they’re probably doing something on it.

5. There are 490,000 AWS developers.  That’s about the population of Cleveland.  Imagine.

5.5. It’s easy to do complex tasks.  Watch for a new open source contribution from me on this one soon.

How To: Force.com API Upsert and Lookup Field Foreign Key Resolution with Sample XML and Sample Code - February 20, 2009 at 8:03 am

You can follow Reid Carlberg on Twitter or email him at rcarlberg@modelmetrics.com.

One of the absolute best features of the Salesforce.com/Force.com API is the ability to handle lookup relationships gracefully using external IDs.  You can easily have one object with an external ID and then add another object with a lookup relationship to the first without having to know the ID Salesforce.com assigned it. You’ve probably seen this in action in the Apex Data Loader. It saves a huge amount of time.*

I recently had to implement this on my own outside of an existing tool.  I had a hard time finding any useful documentation in this area.  This write up aims to fill that gap.

Let me start by describing the objects we’re working with.  I’m using custom objects, but this can work with standard objects as well.  Let’s call them ObjectA and ObjectB.  ObjectB has a one-to-many relationship with ObjectA.  ObjectA has an external ID field (unique, case insensitive) called “ExternalIdOnObjectA”.  ObjectB as a lookup field to ObjectA.  The table for ObjectA is populated.  We’re upserting a group of ObjectB.

The goal is to create something that says, in effect, “when adding this ObjectB, determine the value to store in the field LookupToObjectAFromObjectB using this value, which you can lookup on ObjectA using the field ExternalIdOnObjectA.”  The XML looks something like this:

<…other fields…>
<LookupToObjectAOnObjectB__r>
<type xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">ObjectA__c</type>
<Id xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:nil="true" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
<ExternalIdOnObjectA__c>CC001</ ExternalIdOnObjectA __c>
</ LookupToObjectAOnObjectB __r>
<…other fields…>

A couple of things worth noting:

* The field on ObjectB we’re calling out is the “__r” version and not the “__c”.  If you knew the Salesforce.com ID, you would set it to the “__c” version and be done.
* Note the content of the LookupToObjectAOnObjectB tag includes standard information you would see as part of a regular SObject: Type, indicating that it goes to ObjectA, and ID which in this case is empty since we don’t know it.
* Before closing, we define the ExternalIdOnObjectA field value.

That’s it.  So how do we do this in Java?  Setting a field value in Java is normally just a matter of adding a MessageElement to the SObject.

MessageElementBuilder.getMessageElement(FieldName, FieldValue)

And this is no different.  By the way, “MessageElementBuilder” here is just a little utility class I have that handles – wait for it – building message elements.  It’s the same kind of thing you see in the sample code from

By now you’ve probably figured out where we’re going.  The next step is to build an SObject for the reference first and then set that SObject as the FieldValue for the message element.

SObject foreignKeyToResolve = new SObject();
ret.setType(“ObjectA__c”);
ret.set_any(new MessageElement[] {
MessageElementBuilder.getMessageElement
("ExternalIdOnObjectA__c", "CC001") });

SObject objectBInstance = new SObject();
ret.setType(“ObjectB__c”);
ret.set_any(new MessageElement[] {
MessageElementBuilder.getMessageElement
("LookupToObjectAOnObjectB__r", foreignKeyToResolve) });

And that’s all there is to it. Hopefully this saves you some time down the road.  FWIW, I was working in Java on the Cloud Converter when I wrote this.  However, you should be able to use this technique with any of the toolkits — .NET, PHP, etc.

Good luck!

* In fact, upsert with foreign key resolution saves so much time that I’ve refused to use integration toolkits that don’t support it out of the box.  The good news is that the two major vendors who I have had the joy of talking with about this issue have responded quickly.

Top 10 Force.com Metadata API Lessons Learned - February 19, 2009 at 11:18 am

You can follow Reid Carlberg on Twitter.

Developing Cloud Converter has been a great excuse for me to get deeper into the Salesforce.com / Force.com Metadata API.  Although working with it isn’t rocket science, I’ve come across a few interesting tidbits I thought I would share.  Before I get too deep into this, I should encourage you to read the docs – they’re pretty useful and contain some very useful sample code.

1. Know when to use the standard API’s “Describe” functionality instead of the Metadata API.  In general, the various “describe” calls will give you a great READ ONLY view into your metadata.  If you don’t need to create, update or delete, use Describe.  Otherwise, use the Metadata API. Oh and you’ll want the Metadata API for developer stuff – Apex, Visualforce, etc.

2. Keep in mind that the Metadata API has a different set of limitations and conventions than the standard API.  For example, the standard API is generally synchronous while the Metadata API is asynchronous.  The standard API lets you do several hundred operations at once.  The Metadata API, 10. 

3. Object types matter.  In the Partner WSDL with the standard API, you use generic SObjects and can often combine object types into a single operation.  Not so in the Metadata API.  In the Metadata API, when you’re working with Custom Objects, you can only work with Custom Objects.  You can’t, for example, mix in Custom Fields.

4.  Sequence matters.  For example, you have to create a Custom Object before you can create Custom Fields or a Custom Tab. 

5.  Naming conventions matter.  For example, some object use Dot Notation in the name, others use Hyphen Notation – the same as Dot but with a Hyphen.  For example, if you want to specify that a custom field should be on a particular custom object, MyField on MyObject, for example, you specify a name of “MyObject__c.MyField__c” and the Metadata API will handle it.  On the other hand, if you want to create a Layout called “My Object Layout” for MyObject__c, you would give it a full name of “MyObject__c-My Object Layout”.

6.  The Metadata API is hackable.  No, not in the War Games way (to be honest, I haven’t tried) – hackable in that you can force it to do some interesting things in ways other than specified in the docs if you get stuck.  For example, in Cloud Converter, I decided I didn’t want to go through the trouble of editing the default layout.  Instead, I created a new one and used the Metadata API’s “update” method.  Worked great!

7. Use the source.  I only figured out the hackable part after I spent some time looking at the Metadata XML files you can download from Force.com.  They’re pretty easy to read and will very likely clear up any trouble you’re having figuring out how to do what you want to do.

8.  The Metadata API appreciates some TLC.  You will occasionally need to do things other than the core “create”, “update” and “delete” functions.  For example, I found that I had to bounce my Metadata API session from time to time.  Once was when I was finished creating the fields and needed to then build a layout. The Metadata API was unaware of those fields until I bounced it.  Another example is that I needed to let the system sleep for a bit between creating the custom tab and loading data.  A third example was when I wanted to create Lookup fields.  When I created those in the same call as the regular fields, it failed.  When I segmented them out to their own create call, it worked.  None of these were big deals – just something to keep in mind.

9.  The Metadata API is very literal.  For example, if you create a new custom tab, it will create a tab.  And that tab will be hidden from all profiles until you tell it otherwise.  There are probably a few other things like this.  I’ve been updating this profile setting manually when testing required me to.  See #10 for how stupid this was.

10. The Metadata API is powerful.  If you’re doing something manually that’s vaguely related to metadata, stop.  You can probably do it with the Metadata API and save yourself a bunch of time.  For example, if you, unlike me, read the docs when you ran into the profile / custom tab issue in #9, you would have found the “ProfileTabVisibility” object designed to handle just that. 

That should get you started.  If you run into any other hints or lessons learned I’d love to hear about them.  Feel free to email or comment.

Good luck!

Cloud Converter Update: Converting Your Dirt Bound Database to the Force.com Cloud is Even Easier! - February 17, 2009 at 7:02 pm

You can follow Reid Carlberg on Twitter.

I’ve been working on some Cloud Converter enhancements for the last few days.  Everything is uploaded to Google Code and ready for you to use.

The details:

After an extremely helpful note from an early user, I have changed the way we connect to databases.  It’s now more generic.  This is a good thing.   You specify your DB driver, credentials and query string and CC does the rest.  Remember that you’ll need to import your database driver JAR file if you’re hitting something like Oracle, etc.

You can now specify an “external id” field type.  This is extremely useful for tables that include a surrogate id (identity field, etc).

You can now create picklists from any data you like.  So, for example, if you have a field which contains “red”, “yellow” or “blue”, and that field today is controlled by the UI rather than the DB, you can convert that into a picklist by specifying the field name and query.

You can now create lookup fields that reference other objects perfect for keeping track of your one-to-many type relationships.

You can use foreign keys to determine your lookup field values.  This is the standard upsert based foreign key resolution that’s included as part of the regular salesforce API.

Data can now be loaded as either upsert or insert depending on your needs.

There’s a class that illustrates these pretty clearly – CloudConverterScript_Sample.  Open it in your favorite IDE and you can take a look through how it all works.  I’ve also added a road map section to the readme.txt to keep track of some longer-term goals.

Note: Cloud Converter is undergoing active development.  If you have code modifications that you do not want overwritten by a simple update from Google Code, you should copy those off to a different project before downloading this latest update.

Questions? Comments? Suggestions?  Love to hear them.

Please drop me a note at rcarlberg@modelmetrics.com.

 

 

Is SaaS and Cloud Computing Still on the Rise in this Economy? - February 13, 2009 at 1:19 pm

This has obviously been a hot topic since last fall.  Many have written about it, from Forbes and The Industry Standard on down.  While most seem to be casting their vote for Cloud Computing success through this recession, there are others who are non-believers.  Those who believe in the cloud computing model believe that this mechanism for delivering IT solutions will prosper in a down economy because it is typically booked as an operating expense (vs. a capital expense), you have the ability to reduce your usage and therefore expense, and maintenance and infrastructure/support costs are significantly reduced.

The non-believers are typically the ones that think that either a) IT spending is going to be cut deeply enough so that there are no shining stars or b) Cloud Computing reduces the reliance on IT staffing resources, giving companies a way to reduce employee costs.  While I personally believe that “b” is an absolutely dour way of looking at a solution that could potentially reduce cost and free up resources to focus on higher value add task, that’s a topic for another day. 

No matter which camp you are in, clearly there is not yet consensus on whether or not Cloud Computing is going to be one those shining stars amidst our financial turmoil. SaaS companies are just now reporting on the first quarter of results after the Q408 stock market meltdown.  Successfactors (SFSF) results seemed to be mixed, beating Q4 estimates and guiding in line despite softness in large accounts.  For Citrix Systems, net income was down slightly but the company stated they were pleased with the results in light of the economy.  Amazon.com recently released results that were very well received with the inference from many observers that Amazon Web Services, the company’s cloud computing infrastructure, did exceptionally well.
 
So what really is the argument for SaaS companies to buck the trend of the economic downturn?  My hypothesis is the following:
 
Despite the frequent rhetoric about the lower total cost of ownership for Cloud Computing applications vs. more traditional, on-premise solutions, there’s little concrete evidence that this hypothesis is true.   That is – there are few stories about companies that took a hard look at their situation and clearly determined that Cloud Computing was a cheaper way to go for their specific situation.  And that’s really the key to this question about lower total cost of ownership for SaaS – every company has a different mix of applications, IT infrastructure, staffing, and expertise.  No two are alike.  Therefore there is really not an all-encompassing formula to calculate TCO.
 
So far it appears that Cloud Computing providers are fairing relatively well in light of other industry sectors.  What I believe may be true is this:
 
As of the Fall of 2008, more and more companies are now truly forced to conduct the detailed analysis of total cost of ownership for their various solution options and truly make a technology decision based upon those results.  Of course there are always other factors that influence a technology buying decision, but I believe TCO is now the one that clearly dominates the outcome.
 
I’m sure this has been true of some or many companies in the past, but I believe it is now true of every well-run business.   Salesforce.com reports their fiscal year earnings later this month, so maybe that will shed some more light on this as well.
 
Differing opinions?  I’m sure there are.  Let me know.  Any proof points from companies that have done just this and are willing to share?  We’d definitely love to hear about it.

Clang! Powerful Memory Profiling for the iPhone - February 9, 2009 at 3:54 am

 

I’ll start by saying that Clang is a must-have tool for every iPhone developer. It’s easy to use, and it does a fantastic job of profiling the memory usage of your apps.

The iPhone is a powerful hand-held device, but the memory constraints are tight enough that they can cause serious problems with application performance. With 128 MB of memory on board, other applications running in the background, and a virtual memory model that does not include swap space, it’s easy to run out of memory and crash an app. Even though your iPhone has 8GB or 16GB of Flash storage, memory that your application allocates will not be swapped out to the disk to free up system memory. Since over-releasing objects will crash an application in difficult to understand ways, it can be tempting to be cautious about releasing objects. However, the system monitors memory usage, and shuts down any application that takes up too much memory. This is the cause of a great many application crashes on the iPhone. You can use around 30 MB safely for a sustained period of time. Get closer to 40 or 45 MB, and the system will very likely shut your app down with an exit status of 101.

In order to make sure you’re not leaking memory, it’s important to use memory profiling tools to catch leaks and inefficiencies in your code. The iPhone SDK ships with a handful of useful profiling applications in a package called "Insruments". These programs allow you to watch memory and processor usage while your app is running on your iPhone. Some of the Instruments that are especially useful are Leaks, Object Allocations, and Memory Monitor. These are great tools, but they have some serious limitations. For instance, while Leaks and Object Allocations are fantastic for catching memory leaks, neither one will alert you to a leak of an image object, which seems kind of important. Who cares if you’ve leaked a 48 byte NSString, when you just leaked a 3MB UIImage? Memory Monitor can be useful in this regard, because it lets you monitor total memory usage of all apps running on the device, even the various built-in subsystems like SpringBoard, MobileSafari, and a handful of various daemons. However, it still makes finding an elusive memory leak difficult.

Enter Clang, a static analyzer that is a tremendous asset to any iPhone developer. To use Clang, you build (but not run) your app for the simulator in Debug mode, and then run a Clang analysis on the binary. It will take 15 to 20 seconds to run, at the end of which it generates an HTML file that lists all of the problems that it has found in your code, complete with line numbers and comment blocks explaining the problem. The first time you run it can be pretty shocking. Here are some example screen-shots from a sample run on an XCode iPhone SDK project. First you’ll see a summary box showing the various types of issues that were found in your code:

 

 

As you can see, it’s found a few leaks, and a missing super dealloc method call. If we drill into one of these, we can see some extremely detailed information about the problem:

 

Notice that your actual code is shown, with the problem area highlighted, and comment boxes added in to describe the issue. It looks like we’ve forgotten to release the ns object here. This makes finding and resolving memory leaks much easier than trying to use Instruments to profile an app in real time. Clang will also catch leaked images, which is a huge benefit. Here’s another example of an issue found by Clang:

 

As you can see, this method returns an object with a retain count of 1, but the method name doesn’t start with "new", "copy", or "alloc", and thus violates Objective-C naming conventions. This could be fixed by changing the name of the method to "newSomeMethod", which would likely cause an leak to be flagged in the calling method, or you could autorelease the object on return, and retain it in the caller.

Where to get Clang?

You can download Clang here:

http://clang.llvm.org/StaticAnalysis.html

Using Clang

Clang is run from the command-line, so you’ll have to run it from the Terminal. After installing it, you will also probably want to add Clang to your system path. To do so, in the terminal, create a file named .bash_profile (assuming you’re using the default Bash shell), and add this line:

export PATH=/Developer/Applications/Clang:$PATH

I’ve installed Clang in /Developer/Applications/Clang. You would obviously change this to be your own install location.

To run Clang, you’ll have to restart your terminal session. You then want to build the app in XCode with the Simulator/Debug profile, and navigate to your project directory in the Terminal. Once there, you run these two commands:

rm -rf /tmp/scan-build*
rm -rf build/;scan-build –view xcodebuild

You’ll see a lot of text scroll by pretty rapidly, and when it’s finished, your browser will open up an analysis log on port 8181 (by default). Sometimes the Clang server fails to start. I don’t know why. It seems to happen to me about 25% of the time. If this happens, just repeat the process. It’ll probably work next time.

We All Use Gmail for Personal Stuff, Why Not at Work? - February 6, 2009 at 7:44 am

I just wanted to share my Gmail transition experience over the past 24 hours. 

I was extremely resistant to switching to Gmail.  I’m one of the last in the company to do it.  I love folders, I love offline, I love exchange/outlook/entourage (EOE). But as a company, it just made sense to make the switch.  From a cost perspective, it’s significantly cheaper.  We’re also very much about eating our own dog food, which is cloud computing.  

So I made the switch yesterday.  I was not thrilled.  I asked our IT guy to forward Gmail to EOE, so I could continue to use EOE and my beloved folders as opposed to using online Gmail.  It was slow and wasn’t as great as standard EOE and I was definitely frustrated.  Online Gmail seemed confusing and cluttered and not that great and my standard folders were available there, but not in an ideal fashion, to the bottom on the left of the screen and requiring too many clicks to access. 

I asked the IT guy to sit down with me and try to help me out.  30 minutes later I’m loving this thing.  I’m using only online Gmail, in the way it’s supposed to be used.  EOE is officially turned off forever. 

Here’s what helped me change my thinking: 

  • You can choose different markings to flag various types of emails.  Those are emails that are flagged do show up in a separate folder.  This is immensely helpful for me.  I had previously thought that there were no folders, so it would just be a mess of an inbox with a ton of emails and lots of flags that would take forever to sort through.  So I still get one folder instead of my usual four.  Within that folder though, the different flags are easy to manage and to differentiate between. 

  • You can clean up the screen and remove clutter by clicking on edit labels on the left and by clicking on the Settings and Lab buttons on the upper right.  The Settings let you move stuff around.  The Lab feature (represented by the little green vial) is sort of like an appexchange where you can choose from a bunch of features. 

  • By moving away from EOE and having Gmail forwarded there, you can truly leverage the good parts of Gmail, especially the archiving function and the search capability and the ability to see all emails that are replied to in one string (this is very cool).

  • He turned on the Offline version for me, so I can use Gmail on a plane or whatever.  It looks exactly like standard Gmail, it’s not a separate app, you just happen to be offline. 

Anyway, I’m now done with EOE and it feels really good.  I’m done with bloated software sitting on my machine (read Microsoft).  I’m still getting used to everything, but day two I’m very happy.  If you are worried about switching to Gmail, please give it a try first with someone who’s done it, don’t just get frustrated and try to figure it out yourself.  

My two cents…

ac