Ayende @ Rahien

Refunds available at head office

LightSwitch on the wire

This is going to be my last LightSwitch post for a while.

I wanted to talk about something that I found which was at once both very surprising and Doh! at the same time.

Take a look here:

image_thumb[1]

What you don’t know is this was generated from a request similar to this one:

wget http://localhost:22940/Services/LSTest-Implementation-ApplicationDataDomainService.svc/binary/AnimalsSet_All?$orderby=it.Id&$take=45&$includeTotalCount=

What made me choke was that the size of the response for this was 2.3 MB.

Can you guess why?

The image took up most of the data, obviously. In fact, I just dropped an image from my camera, so it was a pretty big one.

And that lead to another problem. It is obviously a really bad idea to send that image on the wire all the time, but LightSwitch make is so easy, indeed, even after I noticed the size of the request, it took me a while to understand what exactly is causing the issue.

And there doesn’t seems to be any easy way to tell LightSwitch that we want to put the property here, but only load it in certain circumstances. For that matter, I would generally want to make the image accessible via HTTP, which means that I gain advantages such as parallel downloads, caching, etc.

But there doesn’t seems to be any (obvious) way to do something as simple as binding a property to an Image control’s Url property.

Comments

Steve
08/25/2010 05:16 PM by
Steve

Come on now, are you serious? So they promote the ability to add pictures, but they expect it to be delivered in this manner?

So far, you've figure out that there are plenty of potential bottlenecks from network to database to unnecessary transactions to even source control problems (a single file could cause problems for a team if there are any merging issues for example).

Everything written in this series makes it seem like Light Switch was built by a single developer running everything locally...but I know that can't possibly be the case, but it just feels that way. I'm already waiting for the "but it works on my machine!" complaints.

Ayende Rahien
08/25/2010 05:19 PM by
Ayende Rahien

Steve,

That was pretty much my concern. The ability to handle pictures in this fashion is crucial, especially when you make this such a core part of your API.

When every entity is 2MB in size, your app is going to be even slower than your select n+1 will indicate

Steve
08/25/2010 07:34 PM by
Steve

Looking into my magic ball, I can see many developers getting "Hey, I built this application in Light Switch and it was working pretty well for me for a few weeks but now it's slow as hell, can you take a look?" requests in the future.

But the problem is going to be that there won't be much they can do about it without re-writing the application from scratch.

From what you've shown in the last few posts Light Switch is actually worse than I imagined it would be.

James
08/25/2010 08:58 PM by
James

So, yeah, as usual, Microsoft makes it easy to build demo applications that will never in a million years scale.

LightSwitch = MS Word based web development, take 2.

Morten Jacobsen
08/27/2010 11:14 AM by
Morten Jacobsen

Ayende, thanks a lot for your brilliant comments on LightSwitch. It almost let me to drop it. But yesterday I saw the channel9 discussion at ecn.channel9.msdn.com/.../...deLightSwitch_ch9.mp4 by the developers, and I have to say; there is a lot into it.

I´m an accounting domain expert and am now on the verge to release my 8th commercial fincacial product. And what these guy shows and talk goes stright to my heart, and it will be ideal for my ninth product.

So I wil ask you. What actions can I take not to get this N+1? Or, how can I use the tool in a way that make it perform reasonably well on a large scale?

And to make you think twice, if it is a success will you go west across the Mediterean Sea and come to La Vila, Alicante, Spain to help us make it work even better?

/mortjac

Arnis L.
08/27/2010 09:19 PM by
Arnis L.

@Morten

Those guys in vid ain't bad at marketing for sure. I foresee that governments, project managers and people that do not code in general will buy in real easily (<-- count how much times You can hear that word and synonyms of it about lightswitch in video. add that heap of quite random info and basically - You got what is called gypsy hypnosis).

I myself, if I will be forced to use it, will just quit whatever casualties will be. The same with Sharepoint and some other friends. In my reality these things are falsehood.

Comments have been closed on this topic.