投稿時間:2023-03-12 12:10:37 RSSフィード2023-03-12 12:00 分まとめ(11件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
TECH Techable(テッカブル) さくら薬局グループが公式ヘルスケアアプリをリリース。オンラインでお薬管理が可能に https://techable.jp/archives/199038 取り組み 2023-03-12 02:00:26
python Pythonタグが付けられた新着投稿 - Qiita pytorchのperspective transformation(透視変換) https://qiita.com/zhangminglu1999/items/6604eef1af480a0fda99 perspectivetransformation 2023-03-12 11:17:09
python Pythonタグが付けられた新着投稿 - Qiita chatGPTをコマンドラインから実行する術(いまさら) https://qiita.com/taro-yamada/items/790d33730c1e74d32b34 chatgpt 2023-03-12 11:01:53
js JavaScriptタグが付けられた新着投稿 - Qiita json-serverの使い方まとめ【解説】 https://qiita.com/ryome/items/36da51f0f5973eab8720 jsonserver 2023-03-12 11:58:04
js JavaScriptタグが付けられた新着投稿 - Qiita ramda.jsの日本語版解説みたいなものをつくってみた https://qiita.com/Yuumillar/items/f0b94476cd7e6c2f55dd ramdajs 2023-03-12 11:47:53
js JavaScriptタグが付けられた新着投稿 - Qiita ||演算子と??演算子の使い分け https://qiita.com/yuta-10112022/items/9b553c935a435b17a005 使い分け 2023-03-12 11:33:30
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScriptのモジュールを動的に定義する方法 https://qiita.com/suin/items/427d11ca9da397c52520 javascript 2023-03-12 11:32:05
Ruby Rubyタグが付けられた新着投稿 - Qiita ruby.wasmについて https://qiita.com/getty104/items/67245fb24ad101a6ec97 rubywasm 2023-03-12 11:21:55
Ruby Railsタグが付けられた新着投稿 - Qiita rspec-railsとは 100DaysOfQiita 5日目 https://qiita.com/30113011tr/items/e16f890a955dff4fd25a rspecr 2023-03-12 11:57:24
海外TECH DEV Community build resilient applications accessing Azure services with no code. https://dev.to/gkarwchan/build-resilient-applications-accessing-azure-services-with-no-code-48hn build resilient applications accessing Azure services with no code When working on distributed system like systems that are running on the cloud and microservices then you should anticipate transient faults like temporary loss of network connection or temporary unavailability of a service or a service is busy This is why in cloud application the term Building for resiliency become a pattern in building application and it means properly handling these transient faults in the code There are two common used patterns that we can use in our code that can help build resilience application Retry pattern Circuit breaker Pattern The good news is there are libraries that will help you doing that and even the SDKs for some Azure services have these two patterns built in and by just configure the connection properly you will get this benefits without writing your own code for those Retry PatternThe retry pattern means if calling a service failed you wait for a short time and then retry again because you expect the problem will be resolved shortly You try not only one time but maybe for times and leave a short waiting time between the retries Services that support retry Azure SQL Server and Entity Framework Entity Framework has a built in retry technique when it comes to communicate with Azure SQL Server services AddDbContextPool lt ConcertDataContext gt options gt options UseSqlServer sqlDatabaseConnectionString sqlServerOptionsAction sqlOptions gt sqlOptions EnableRetryOnFailure maxRetryCount maxRetryDelay TimeSpan FromSeconds errorNumbersToAdd null Azure Cache for RedisIf you are using the most famous Redis NET library which is StackExchange Redis then the library has the mechanism for retry as follows var options new ConfigurationOptions EndPoints localhost ConnectRetry ReconnectRetryPolicy new ExponentialRetry TimeSpan FromSeconds TotalMilliseconds TimeSpan FromSeconds TotalMilliseconds ConnectTimeout ConnectionMultiplexer redis ConnectionMultiplexer Connect options writer Azure Service BusThe NET package for the service bus Azure Messaging ServiceBus has built in support for retry using the configuration of its client var options new ServiceBusClientOptions options RetryOptions new ServiceBusRetryOptions Delay TimeSpan FromSeconds MaxDelay TimeSpan FromSeconds Mode ServiceBusRetryMode Exponential MaxRetries await using var client new ServiceBusClient connectionString options More Azure service support retryI am not going to list the code for all services but just check the SDK for each service and you will find how to enable the retry features But these services will support the feature Azure Cosmos DBAzure Active DirectoryAzure SearchEvent HubIoT HubAzure Storage Retry using PollyIf you need to connect to other API services or you need to connect to Azure SQL but without Entity Framework then you need to implement the code yourself But there is a NET package that is already doing that Polly Let us see for example how to connect to SQL using ADO NET and Polly public async static Task lt SqlDataReader gt ExecuteReaderWithRetryAsync this SqlCommand command GuardConnectionIsNotNull command var policy Policy Handle lt Exception gt WaitAndRetryAsync retryCount Retry times sleepDurationProvider attempt gt TimeSpan FromMilliseconds Math Pow attempt Exponential backoff based on an initial ms delay onRetry exception attempt gt Capture some information for logging telemetry logger LogWarn ExecuteReaderWithRetryAsync Retry attempt due to exception Retry the following call according to the policy await policy ExecuteAsync lt SqlDataReader gt async token gt This code is executed within the Policy if conn State System Data ConnectionState Open await conn OpenAsync token return await command ExecuteReaderAsync System Data CommandBehavior Default token cancellationToken Circuit breaker PatternThere is a problem with the retry pattern What if a service was down and stayed down for long time Then every time we call this service we are going to call it three times and wait for a second between these calls This will add delay for our application The Circuit breaker pattern will fix this by assuming the service is down after many failed calls If the service marked as down then code will immediately fail the call without even calling the service This state is called Open Circuit Then the code will wait for a while before it try again to call the service and if it is still failing then the state will still be Open otherwise it is marked as healthy and the state will beClosed Circuit Circuit breaker should be used in conjunction with the retry pattern Using Cicruit breaker with Polly There is built in implementation of circuit breaker in SDKs of Azure services but we can achieve it using Polly package as follows csharpprivate static IAsyncPolicy lt HttpResponseMessage gt GetCircuitBreakerPolicy return HttpPolicyExtensions HandleTransientHttpError CircuitBreakerAsync TimeSpan FromSeconds 2023-03-12 02:08:54
ビジネス 東洋経済オンライン 「上から目線の男」が周囲に心を開くに至ったワケ 漫画「ぼっち死の館」(第3話) | ぼっち死の館 | 東洋経済オンライン https://toyokeizai.net/articles/-/653007?utm_source=rss&utm_medium=http&utm_campaign=link_back 上から目線 2023-03-12 12:00:00

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)