The Microsoft Northwind sample uses the Order Detail table to establish a many-to-many association between Orders and Products.
Object to relational mapping specifications (ORMs) such as the ADO.NET Entity Framework and Java Persistence API (JPA) can map the tables and relationships using entities. However, this architecture is does not scale. Everything must be located on the same machine, or an expensive cluster of machines to perform well.
In order to create a scalable version of the sample, the entities must be modeled such that each entity or group of related entities can be partitioned based off a single key. By doing this, requests can be spread out among multiple, independent servers. To achieve this, the entities have been divided into two trees: The Customer/Order tree (see Figure 3) and the Product/Category tree (see Figure 4). In this model, each tree can be partitioned independently and therefore can grow at different rates and scale.
For example, both Order and Product have unique, separate integers as keys. In fact, the Order and Product tables are really independent of each other. For example, consider the effect of the size of a catalog (number of products you sell) with the total number of orders. Intuitively, it may seem that having many products implies also having many orders, but this is not necessarily the case. If this were true, you could easily increase sales by just adding more products to your catalog. Orders and products have their own independent tables. You can further extend this concept so that orders and products each have their own separate, eXtreme Scale grids. With independent grids, you can control the number of partitions and servers, in addition to the size of each grid separately so that your application can scale. If you double the size of your catalog, you must double the products grid, but the ogrid may be unchanged. The converse is true for an order surge, or expected order surge.
In the schema, a Customer has zero or more Orders, and an Order has line items (OrderDetail), each with one specific product. A Product is identified by id (the Product key) in each OrderDetail. A single grid stores Customers, Orders and, with Customer as the root entity of the grid. You can retrieve Customers by Id, but you have to get Orders starting with the Customer id. So customer id is added to Order as part of its key. Likewise, the customer id and order id are part of the OrderDetail id.
In the Category and Product schema, the Category is the schema root. This allows customers to query products by category. See the following section for additional details on key associations and their importance.