Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 6,128 | Comments: 45,546

filter by tags archive

LightSwitch on the wire

time to read 2 min | 265 words

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:


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.



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


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


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.


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

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?


Arnis L.


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.

Comment preview

Comments have been closed on this topic.


  1. The low level interview question - 11 hours from now
  2. The worker pattern - 3 days from now

There are posts all the way to May 30, 2016


  1. The design of RavenDB 4.0 (14):
    26 May 2016 - The client side
  2. RavenDB 3.5 whirl wind tour (14):
    25 May 2016 - Got anything to declare, ya smuggler?
  3. Tasks for the new comer (2):
    15 Apr 2016 - Quartz.NET with RavenDB
  4. Code through the looking glass (5):
    18 Mar 2016 - And a linear search to rule them
  5. Find the bug (8):
    29 Feb 2016 - When you can't rely on your own identity
View all series



Main feed Feed Stats
Comments feed   Comments Feed Stats