简体   繁体   中英

Azure - Table Storage modeling

Is there an reference about how to properly design Table Storage data? What to put in the partition and what in the table? Are there any principals to follow(like ER model in SQL)?

In general, you need to ensure that your content-searching will be efficient. Data is stored based on partition key and indexed on row key. If, say, you have app ID as partition key and customer ID as row key, you'd have very fast searching for a customer. However: Imagine having to search by customer's last name (another property). Now you'd need to do a table scan within the app's partition. You might need a second table to map customer's last name (as row key) to customer ID (a property).

To see some real-world guidance, take a look at this msdn article .

Another perspective is to envisage the Partition + Row Key as analogous to a Primary Key (stored in clustered index form) of a SQL Server database.

Determine the Primary Key as a composite key, of one or more sub keys (depending on your query needs) and then split the primary key into a partition segment and a row segment appropriately, depending on the scalability requirements of your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM