Cloud computing Design Pattern (14)--manifested view mode

Source: Internet
Author: User

Cloud computing Design Model (14)--manifested view mode


When a pre-populated view of data in one or more data stores is generated, the data is formatted in a way that is detrimental to the desired query operation. This pattern can help support efficient querying and extracting data, and improve application performance.

Background and issues


When data is stored, the priority for developers and data administrators is often focused on how the data is stored, not how it is read out. The storage format you choose is typically closely related to the data that is used to manage the size of the data and the integrity of the data, and the type of storage that is used in the required format. For example, when using a NoSQL literature store, the data is usually represented as a series of aggregates, each of which contains all the information about that entity.

However, this can have a negative impact on the query. When a query takes a subset of the aggregated data from some entities, such as orders of several customers without all the order of information, it must extract all the relevant entity data to obtain the required information.

Solution Solutions


To support efficient queries, a common solution is to generate, in advance, a graph of the format that is most appropriate for the desired result set in the materialized data. Where the source data is not a format appropriate for a query, there is an appropriate query in which the manifested view pattern describes the pre-populated view that produces data that is difficult in the environment, or where the query performance is poor due to the data or the nature of the data store.

These materialized views, which contain only the data needed for a query, so that the application can quickly get the information they need. In addition to connecting tables or grouped data entities, materialized views can include computed columns or data items that are specified as part of a query's current values, combined values, or the results of transformations performed on data items, and values. Materialized views can even be optimized for a single query.

The key point is that a manifested view that contains the data is completely disposable because it can be rebuilt entirely from the source data store. A materialized view is an application that cannot be updated directly, so it is actually a dedicated cache.

When the view changes the source data, the view must be updated to include the new information. This can occur automatically on the appropriate schedule, or when the system detects changes to the original data. In other cases, you may need to regenerate the view manually.

Figure 1 shows an example of how the manifested view pattern might be used.

Figure 1- manifested view mode

Issues and considerations


When deciding how to implement this pattern, consider the following points:
• Consider how and when the view will be updated. Ideally, it will be regenerated in response to an event indicating a change to the source data, although in some cases this may lead to excessive overhead if the source data changes drastically. Or, consider using a scheduled task, an external trigger, or a manual action to initiate the regeneration of the view.
• In some systems, it may be necessary to use an event purchase pattern to persist only modified data for the event store, for example , a manifested view. The only way to store information from events can be obtained by examining all events to determine the current state of pre-populated views. The advantage of measuring is that materialized views can be provided when using event sourcing than in other cases. Materialized views are often specific to one or a few queries. If many queries must be used, maintaining a materialized view can result in unacceptable storage capacity requirements and storage costs.
• When a view is generated, and when the view is updated, this occurs when a schedule considers the impact of data consistency. If the source data changes, the point at which the view is generated, the data in that view may be copied in exactly the same data as the original.
• Consider where you will store the view. The original data that is considered unnecessary to be located in the same store or partition. It may be a subset of merging from several different partitions.
• If the view is transient, it is simply used to improve query performance by reflecting the current state of the data, or to improve scalability, it can be stored in the cache or in a less reliable location. It can be rebuilt if it is lost.
• When defining a view of the conversion of a solid view, on the basis of a data item or column, or an existing data item, the value is passed in the query, or on those values, where this is the appropriate combination to play its maximum value.
• Where the storage mechanism supports it, consider indexing the manifested view to further improve performance. Most relational databases support the idea of indexing because this is done based on Apache Hadoop's Big Data solution.

when to use this mode


This model is ideal for:
• Create materialized views the above data is difficult to query directly, or the query must be extracted in a normalized, semi-structured or unstructured way data is very complex.
• Create a temporary view that can significantly improve query performance, or directly act as a UI source view or data Transfer object (DTO), report, or display.
• Support occasionally connected or disconnected situations where connecting to a datastore is not always available. This view may be cached locally in this scenario.
• Expose data for experimentation by simplifying queries and exposing knowledge in a way that does not require the source data format. For example, by combining different tables in one or more database, or in a NoSQL storage domain, and then formatting the data to meet its end use.
• Provide access to a specific subset of the source data, for security or privacy reasons, should not be general access, publicly modified, or completely exposed to the user.
• Use different data based on their personal abilities to store in bridging disjointed. For example, by using cloud storage, it is efficient to write relational databases that are stored as baseline data and that can provide good query and read performance to keep materialized views.

This mode may not be suitable for the following situations:
• Simple source data for easy querying.
• The source data changes very quickly, or can be accessed without using a view. The overhead of creating view processing in these scenarios may be avoided.
• Consistency is a high priority. Opinions may not always be exactly the same as the original data.

Example


Figure 2 shows An example of using the manifested view pattern. In the order, the order item data, and the customer in the separate partition table of the Microsoft Azure storage account are combined to generate a view that contains the total sales totals for each product in the electronic category, and the customer is the count of the number of purchased items together for each item.

Figure 2- summary of sales generated using the manifested view mode


Creating this materialized view requires a complex query. However, by using query results as a manifested view, users can easily get results and use them directly, or incorporate them into another query. The idea is likely to be used in a reporting system or dashboard, so you can update the schedule based on, for example, once a week.

Attention:

Although this example uses Azure table storage, many relational database management systems also provide native support for materialized views.

This article is translated from msdn:http://msdn.microsoft.com/en-us/library/dn589782.aspx

Cloud computing Design Pattern (14)--manifested view mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.