azure-table-storage

Is it OK to store different data types on the same Azure Table storage "column" (under the same key)?


Is it OK when most of my rows include an Int32 value under a given key, but sometimes contain a String instead?

I want to do this to set them to "null" to work around the fact that values cannot be otherwise removed inside a merge operation.

Are there any functional/performance drawbacks to this?


Solution

  • Is it OK when most of my rows include an Int32 value under a given key, but sometimes contain a String instead?

    Yes, this is perfectly ok to do so. Unlike a relational database, Azure Table Storage is a key/value(/type) based store where each entity (equivalent to a row) can have attributes with different data types. So you could have one entity with an attribute with string data type and another entity with the same attribute name but with an int data type.