DynamoDBContext线程安全吗? [英] Is DynamoDBContext Thread Safe?

查看:96
本文介绍了DynamoDBContext线程安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 AmazonDynamoDBClient 是线程安全的,我可以在应用程序启动时初始化一个单例,并在整个应用程序生命周期内继续使用它。

I know that the AmazonDynamoDBClient is thread-safe and I can init a singleton when my app starts and keep using it throughout the apps lifetime.

是否同样适用于 DynamoDBContext

推荐答案

是的,DynamoDBContext是线程安全的。

Yes, the DynamoDBContext is thread-safe.

它还维护着从DynamoDB填充的许多缓存(如表描述),因此最好将实例保持尽可能长的时间。这将有助于避免进行额外的服务调用来重新填充缓存。

It also maintains a number of caches (like table descriptions) which are populated from DynamoDB, so it's best to keep an instance around for as long as possible. This will help avoid making extra service calls to repopulate the caches.

这篇关于DynamoDBContext线程安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆