Few facts about Windows Azure Mobile Services

Damir Dobric Posts

Next talks:



Follow me on Twitter: #ddobric





Insert big amount of data is not the best option

If you want to insert a bigger amount of data the Mobile Services SDK is not the best way to do that. Following code snippet shows how to insert 1000 records in a simple table.
By using WLAN with approximately 15 MBit upload rate we can expect 240-260 ms per insert-record. If you need higher rate the solution is to build application (backend or desktop on – system32)
and to insert records directly in the table.

var tbl = App.MobileService.GetTable<Movie>();


Stopwatch w = new Stopwatch();

for (int i = 0; i < 1000; i++)
   await tbl.InsertAsync(new Movie() { Title = "Otac na sluzbenom putu" + i.ToString(), Description = "Ma dosta ga je ba" + i.ToString(), ChannelUrl = App.CurrentChannel.Uri });

Btw. 1000 records is never ever a big amount :)

Reading is relative fast

In contract to insert operation reading is a bit faster. By using WLAN with approximately 50MBit download rate, we can achieve 2ms per records.

List<Movie> movies = await tbl.Where(i => i.Title.StartsWith("Otac")).Take(1000).ToListAsync();

In this test the table has contained up to 2000 records.

You can get maximum 1000 records per requests

You cannot retrieve any number of records from table. The maximum number of records which can be retrieved is 1000. If you execute the code below, you will get following exception:
The value of the $top query option cannot exceed 1000.  (400 BadRequest - Details: {"code":400,"error":"The value of the $top query option cannot exceed 1000."})

var tbl = App.MobileService.GetTable<Movie>();

List<Movie> movies = await tbl.Where(i => i.Title.StartsWith("Otac")).Take(1500).ToListAsync();


Default number of returned records is 50

If you do not specify the number of records to be retrieved, the default number of records is limited to 50. For example, folowing code will retrieve 50 records, although the table contains more than 1000 records.

List<Movie> movies = await tbl.Where(i => i.Title.StartsWith("Otac")).ToListAsync();


Posted Sep 27 2012, 12:46 PM by Damir Dobric
Filed under: , ,


Catalin's Blog wrote WP8 is around the corner what next presentation at Sinergija 2012
on 10-23-2012 19:21

This year also I had the honor and priviledge to be speaker at Sinergija. and some supporting materials

developers.de is a .Net Community Blog powered by daenet GmbH.