キー付きデータページ
データページは、データベースやウェブサービスなどのデータソースに問い合わせを行うのではなく、情報をメモリにキャッシュすることで、Pega Platform™アプリケーションのパフォーマンスを向上させます。データページは通常、項目一覧または単一の項目に関する情報のいずれかを返します。データページを多用するアプリケーションでは、データソースとのやり取りが頻繁に行われるため、パフォーマンスに問題が生じることがあります。
たとえば、ある自動車販売店では、顧客が現在在庫のある車両を閲覧したり、在庫内の車両の詳細を確認したりできるアプリケーションを提供しています。この販売店は、顧客が在庫内の自動車を閲覧することにより、在庫のシステムオブレコード(SOR)に毎日何千件ものリクエストが送られていることに気づきます。大量のデータベースクエリーは、販売店のウェブサイト上の車両情報へのアクセスに影響を及ぼし、潜在顧客のユーザーエクスペリエンスに影響を与えます。 顧客が車種、色、モデル、価格帯を異なる組み合わせで選択する毎に、アプリケーションはデータベースアクセスし、データページを更新します。
リスト構造データページの特定の項目に対する即時アクセスを提供するには、キー付きアクセスを有効にします。キー付きアクセスを使用することで、項目のリストを返すページと、1項目に関する情報を返すページという2種類の別々のデータページを維持する必要がなくなります。アプリケーションで使用するデータを取得する際に、キー付きデータページを使用すると、システムオブレコードとのやり取りの回数が減り、処理が効率的になります。
「+」アイコンをクリックすると、キー付きデータページの使用によりデータベースクエリーの数がどのように削減されるかを確認できます。
Match the numbers to the following image to see how using a keyed Data Page reduces the number of database queries:
- Browse vehicles: Using a keyed Data Page reduces the number of database transactions, allowing the customer to view as many different combinations as they choose, without affecting database performance.
For example, an automobile dealer configures keyed access to a Data Page listing the vehicles in inventory to reduce the number of queries to the inventory system. The dealer configures the application to load the current inventory to a Data Page on the first request by the customer that day. When the customer changes the selected vehicle, the data is returned from the pre-loaded Data Page rather than from the inventory database, reducing the number of queries made to the system of record and improving the user experience. -
Change options: Each line in the Browse vehicles Case represents the customer selection of a different vehicle type, color, model year, and price. The application accesses the data from keyed Data Pages instead of making a trip to the system of record for each selection.
Without a keyed Data Page, the application is required to access and return data from the database for each selection, potentially slowing application performance for all users. -
Keyed Data Page: Keyed Data Pages are used to reduce the number of trips required to obtain data from a database. On the first request, the data is pulled into the Data Page. Because the Data Page uses a key, additional trips to the system or record are not required unless the source data changes.
-
Database: SOR represents the database that houses the source data, including the vehicle type, color, model year and price. The data may be housed externally in a client legacy system, or in a third party database, such as a manufacturer's website, accessed through an interface.
キー付きデータページの使用例
データページでキー付きデータアクセスを使用するかどうかを決定する際には、アプリケーションのパフォーマンスとデータ管理のニーズを考慮してください。データページをキー付きの設定にするしないかは、データページの情報が古くなったと判断されるまでに発生するリクエストの数によって決まります。
以下の2件の使用例について考えてみてください。
ユースケース1:キー付きなしの設定
保険契約の見積もりと保険証券の発行を行うケースタイプでは、システムオブレコードから顧客情報を入力します。このケースタイプは1件の顧客レコードにのみアクセスし、顧客レコードの情報はケースごとに1回だけアクセスされます。
次の新しい保険の見積もりケースの例では、顧客情報へのアクセス頻度は低く、ケースタイプでは顧客情報を取得するためにサーバーに一度だけアクセスする必要があります。各ケースは1人の顧客を対象にしているため、他の顧客に関する情報はケースには関係ありません。このような使用例では、キー付きデータページを使用しても、パフォーマンスの向上は見込めません。
次の図で「+」アイコンをクリックすると、データページがキー付きデータアクセスなしでシステムオブレコードにアクセスする仕組みが表示されます。
Match the numbers to the following image to see how the Data Page accesses the system of record without keyed data access:
- New insurance quote: When a customer requests an insurance quote, a new insurance quote Case opens, and the application loads a non-keyed Data Page to populate the customer's information.
-
Another new insurance quote: Each new insurance quote is unique to the customer who requested it.
-
Data Page: The Data Page stores the customer information, such as their date of birth and driver's license information, used during the quoting process. As the customer information is unlikely to change during the quote, there is no need to make multiple trips to the system of record. A non-keyed Data Page works well in this scenario.
-
Database: The system of record stores insurance customer information, including name, date of birth, and contact information.
When a new insurance quote is opened, the Data Page checks the database to see if the customer exists. If the customer exists, the database provides the customer data to the Data Page.
If the customer does not exist, the Data Page is configured to write a new customer record to the database.
ユースケース2:キー付き設定
あるケータリング業者は、顧客がイベント用のメニューや食事メニューをカスタマイズできるケースタイプを提供しています。このケースタイプで、顧客は複数のステップを経てケータリングを選択します。各ステップでは、メニューやダイニングオプション、前菜、メイン料理、テーブルサイズ、椅子の種類など、イベントの特定の部分に焦点を当てています。 価格や在庫情報は、多いときには毎日変更されます。
次の例では、ケースごとに頻繁にデータがリクエストされることが予想され、リクエスト間でソースデータが変更されない傾向があります。この使用例では、キー付きデータページを使用することで、1つのケースに対するシステムオブレコードとのやり取りの回数が減り、パフォーマンスが向上します。
次の図で、「+」アイコンをクリックすると、キー付きデータページを使用することで、データベースインタラクションの数が減少し、データベースのパフォーマンスが向上する仕組みが表示されます。
Match the numbers to the following image to see how a keyed Data Page improves database performance by reducing the number of database interactions:
-
New catering order: When a customer requests catering, a new catering order is opened using a keyed Data Page pre-populated from the system of record with menu options, table sizes, chair types, and pricing.
-
Customer choices: As the customer chooses different options for their catering event, such as appetizers or decor colors, the application provides a list stored in a keyed Data Page. Additional trips to the database system are not required, as all the data needed for the Case is pre-loaded into keyed Data Pages.
-
Database interactions: The Data Page accesses the catering options for the Case only once because the catering options, including menu, chair types, and table sizes, do not change frequently. Once the customer finalizes options for their catering event, the Data Page writes a new record to the database to store the client's catering event selections.
-
Database: In this example, only one database or system of record is shown.
However, your application may require multiple databases to support a Case Type, such as one database that stores catering locations, another that stores tables, chairs, and linen inventory, and a third that contains catering staff schedules.
Reducing the number of times your application accesses databases to populate the Data Page can significantly improve your application performance.
以下のインタラクションで理解度をチェックしてください。
このトピックは、下記のモジュールにも含まれています。
- キー付きデータページ v7