LoginSignup
0
0

More than 5 years have passed since last update.

SharePoint ビジネスデータのキャッシュについて(まとめ切れていない情報集)

Posted at

Caching in SharePoint

Caching and the BDC

The Business Data Catalog (BDC) manages metadata for Web services and database services. It also provides a standard set of Web Parts that can be bound to that metadata without requiring any code. For more information, see Consuming Web Services with the Business Data Catalog (BDC). However, the default implementation of the BDC service and the related Web Parts do not provide a caching mechanism for storing the retrieved information. You can still take advantage of the BDC and cached information if you develop custom Web Parts to render the data. For an example, see Repositories in the Partner Portal. The entity information is retrieved from the BDC and is stored directly into the ASP.NET cache.

Consuming Web Services with the Business Data Catalog (BDC)

Caching

The Business Data Catalog (BDC) caches the metadata information it uses such as service definitions, operations, and associations. However, in the case of the retrieved back-end data, the BDC Web Parts and the underlying BDC data infrastructure do not provide a built-in caching mechanism. Calls are made to the back-end data source each time the data is accessed. The frequency of these calls may negatively affect an application's overall performance. The only way to provide caching and to use the BDC is to either to implement your own Web Parts or to code your business components. You can do this for frequently accessed or computationally intensive views while relying on the standard Web Parts for the rest of the user interface.
The Partner Portal application uses custom Web Parts in the product catalog to cache navigation, product, and category information. The site navigation menu uses the BusinessDataCatalogSiteMapProvider Web Part. The product details page uses the ProductDetails Web Part and the RelatedParts Web Part.
Cached information is kept in an instance of the ASP.NET System.Web.Caching.Cache class. This is a local in-memory cache, which could be different in different in a Web front end server. Using an in-memory cache is an acceptable technique for information that changes infrequently or at predictable intervals. There is a risk that a user will see outdated information if the back-end data changes before the cached data expires on a server within a farm.
The Contoso.LOB.Services.Client\Repositories\CachedBdcProductCatalogRepository.cs file demonstrates the implementation of the caching mechanism. For more information, see Caching in SharePoint.

BDC アーキテクチャ

Administration オブジェクト モデル

Administration オブジェクト モデルを使用して、BDC Metadata Store のメタデータ オブジェクトの作成、読み取り、更新、および削除を実行できます。このモデルは、発行時に本格的なメタデータの検証を提供し、ストア内の参照整合性を維持します。このモデルでは、パフォーマンスを向上するためにメモリ内メタデータ キャッシュを使用します。このため、比較的待ち時間が長く、BDC が展開内のすべてのフロントエンド Web サーバーとアプリーション サーバーのキャッシュを更新するまで最大 1 分の遅延が発生します。このコンポーネントは、Business Connectivity Services のサーバー展開にあります。クライアント バージョンの Administration オブジェクト モデルは、クライアントにあります。

メタデータ キャッシュ

パフォーマンスを向上するために、BDC は、すべてのメタデータ オブジェクトをキャッシュします。このように、キャッシュからすべてのメタデータ オブジェクトを具現化し、Runtime オブジェクト モデルに一度に提供するため、メソッド呼び出しごとにメタデータ データベースにラウンドトリップしません。メタデータ キャッシュは、メタデータ オブジェクトを呼び出すクライアントが、メタデータ オブジェクトにすばやくアクセスできるようにします。
メモ
オブジェクト モデルを使用して、個々のメタデータ オブジェクト レベルでキャッシュをオンまたはオフにすることができます。このため、ほとんど使用しないオブジェクトをキャッシュする必要がありません。
BDC は、最初の読み込み時にオブジェクトをキャッシュします。各サーバーで実行されているタイマーは、1 分ごとにメタデータ オブジェクトに対する変更がないかを確認します。メタデータ オブジェクトへの変更を確認すると、キャッシュをクリアして、再度読み込みます。その結果、メタデータを変更した後は、ファーム内のすべてのサーバーに変更内容が伝達されるまで、最大 1 分待機する必要があります。変更を行ったサーバー上では、すぐに変更されます。

Caching data for the BDC

Code Snippet: Update Properties of a BCS Cache Subscription

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0