![]() ![]() $filter=(PartitionKey eq 'Sales') and (RowKey eq you query for a range of employee entities, you can specify a range sorted in employee ID order, or a range sorted in email address order by querying for entities with the appropriate prefix in the RowKey.$filter=(PartitionKey eq 'Sales') and (RowKey eq 'empid_000223').The following two filter criteria (one looking up by employee ID and one looking up by email address) both specify point queries: The prefix values for the RowKey, "empid_" and "email_" enable you to query for a single employee or a range of employees by using a range of email addresses or employee IDs. If you store an entity with the structures shown below, you can efficiently retrieve employee entities based on email address or employee ID. To work around the lack of secondary indexes, you can store multiple copies of each entity with each copy using a different RowKey value. In addition, there is no option to request a list of employees sorted in a different order than RowKey order. This is because the table service does not provide secondary indexes. If you also want to be able to find an employee entity based on the value of another property, such as email address, you must use a less efficient partition scan to find a match. ![]() A client can also retrieve entities sorted by employee ID within each department. For example, using the table structure shown below, a client application can use a point query to retrieve an individual employee entity by using the department name and the employee ID (the PartitionKey and RowKey values). This enables a client application to retrieve an entity efficiently using these values. The Table service automatically indexes entities using the PartitionKey and RowKey values. Updates between copies can be kept consistent using entity group transactions (EGTs). Store multiple copies of each entity using different RowKey values (in the same partition) to enable fast and efficient lookups and alternate sort orders by using different RowKey values. For example, one of the key scenarios for Table Service is to use the Materialized View Pattern from the Command Query Responsibility Segregation (CQRS) pattern. There are many other patterns that are worth considering. The pattern map above highlights some relationships between patterns (blue) and anti-patterns (orange) that are documented in this guide. ![]() The following diagram summarizes the relationships between the different patterns: ![]() Also, you will see how you can practically address some of the issues and trade-offs discussed in other Table storage design articles. This article describes some patterns appropriate for use with Table service solutions. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |