Azure Table InsertOrMerge Upsert: Can the to-be-merged object be dynamically created?

Proposed Azure Table InsertOrMerge Upsert: Can the to-be-merged object be dynamically created?

  • Tuesday, August 28, 2012 4:01 PM
     
     

    I need to merge a dynamic list of properties into what is already saved in Azure table. From my research "upsert" with "insert or merge" is the correct approach.

    • How do I get the C# language to permit a dynamic list of properties to be saved?

    • Is raw XML editing the only way to accomplish this?

    http://stackoverflow.com/q/12159137/328397

All Replies

  • Tuesday, August 28, 2012 10:54 PM
     
     
    • How do I get the C# language to permit a dynamic list of properties to be saved?

    Hi ChrisLaMont,

    Just to be sure... Can you specify a class representation of the list of properties you wish to save in Windows Azure Table Storage?


    Best Regards,
    Carlos Sardo

  • Wednesday, August 29, 2012 4:04 AM
     
     

    Here is more detail

    I am using an entity object to track what is essentially an array of N length, where N < 240 (255 is the maximum number of properties available).  Each position in the array corresponds with a property name like this:

     /* Note: Each number is prefixed by "a" since properties can't start with a number */

    public class MyFatEntity
    {

    public string A01 {get;set;}

    public string A02 {get;set;}

    // ..

    public string A10 {get;set;}

    // ..

    public string AF0 {get;set;}

    }

    I require the ability to match a string against any specific position of the array.  I plan to use projection with this.

    One issue that I forse is that if I create a large fat object with 240 properties, then I am consuming storage bandwidth and creating inefficiencies that don't need to exist.  

    Not to mention these additional properties, even if null, will count against my maximum entity size.  This is not desired since the intrinsic overhead means I'll have less room to save data for longer records.

  • Wednesday, September 05, 2012 1:59 PM
     
     
    bump - does anyone have an idea?
  • Thursday, September 06, 2012 12:00 AM
     
     Proposed

    I have written an open source client, Lucifure Stash, available on CodePlex and via NuGet, which will allow you to persist an array to Azure Table Storage, one array element per column.

    Lucifure Stash also supports dynamic properties via a  dictionary and could be ideal for ‘insert-merge’. (http://lucifurestash.codeplex.com/)

    What it does not support is the ability to query on individual array elements. Please note that unless the query is bound by a tight Partition and/or Row Key range, queries on non-key elements could be inefficient.

    • Proposed As Answer by Carlos Sardo Thursday, September 06, 2012 7:39 AM
    •