6. パフォーマンスの⾼い Web サイトやモバイルアプリを作る
遅い Web サイト、使い勝⼿の悪いモバイルアプリは、アクセス放棄、収益の損失、⼆度と戻ってこない訪問者につながる
Web サイトにたどり着いた後、
60%のユーザーは、求めている
情報が⾒つかるかどうかで、サイト
に留まるか、バウンスするかを判断
15秒ルール
Web サイトのパフォーマンスを維持する
ためには、リアルタイムで観測可能な
ツールが不可⽋
測定、監視、最適化
9. The Elasticsearch Platform
Enterprise Search Observability Security
Kibana
Explore, Visualize, Engage
Elasticsearch
Store, Search, Analyze
Integrations
Connect, Collect, Alert
Public cloud Hybrid On-premises
In a world where endless data creates endless possibility, search helps people and organizations thrive.
22. Architecture of The Gallivant Web Shop
Internet
Ship
metrics
& logs
End
user
Elastic Stack
Actions
Backend
micro services
Monitoring
Cart
Catalog
Ordering
Checkout
Search
React Client DevOps
Engineer
SecOps
Engineer
Marketer
…
End
user
Public Cloud
23. APIs
検索のない世界から App Search がある世界へ
Great
Search
コアテクノロジー コンテンツの格納 UI/UX
検索結果の
コントロール
No
Search
Elasticsearch
Search UI
検索結果
オートコンプリート
フィルター
ファセット機能
分析
関連性チューニング
検索の再現・テスト
Dashboard
Web Crawler
66. Model の作成
• Elasticsearch のデータ
から JSON にシリアライズ
のため必要
• Book という名のクラスを
追加
public class Book
{
public string Title { get; set; }
public string Isbn { get; set; }
public int PageCount { get; set; }
public string ThumbnailUrl { get; set; }
public string ShortDescription { get; set; }
public string LongDescription { get; set; }
public string Status { get; set; }
public string Authors { get; set; }
public string Categories { get; set; }
}
67. Elasticsearch への接続を作成
• NEST ライブラリ追加
• Program.cs への追加
dotnet add package NEST
using Elasticsearch.Net;
using Nest;
using Elastic.Apm.NetCoreAll;
===
var pool = new SingleNodeConnectionPool
//ローカル実⾏の場合
(new Uri(“http://localhost:9200”));
var settings = new ConnectionSettings(pool)
.DefaultIndex("books");
var client = new ElasticClient(settings);
services.AddSingleton(client);
---
//Elastic APM 追加
app.UseAllElasticApm(builder.Configuration);
app.UseHttpsRedirection();
app.UseBlazorFrameworkFiles();
app.UseStaticFiles();
---
68. Elasticsearch への接続を作成 - Elastic Cloud ⽤
•
var pool = new SingleNodeConnectionPool
(new Uri(http://localhost:9200/));
// Elastic Cloud デプロイ時に取得した値3つ (例)
https://elastic:oRHGj80iJUO6CF7WBUMiwyu1x@8009bf958
b6w5923b3c56983d4048df824.japaneast.azure.elastic-
cloud.com:9243