简体   繁体   English

AWS单个会话还是多个会话?

[英]AWS single session OR multiple sessions?

I am creating an application in Golang hosted on AWS cloud, that uses multiple AWS services ie S3, DynamoDB, Parameter Store. 我正在托管在AWS云上的Golang中创建一个应用程序,该应用程序使用多个AWS服务,即S3,DynamoDB,Parameter Store。

Currently Individual modules handing each AWS service has their own AWS session. 当前,处理每个AWS服务的各个模块都有自己的AWS会话。

awsSession, err := session.NewSession(&aws.Config{Region: aws.String(os.Getenv("AWS_REGION"))})

From performance perspective, is this a correct way, or having a single session created in the main program and passing the reference to individual module will be a better approach? 从性能的角度来看,这是一种正确的方法,还是在主程序中创建单个会话并将引用传递给各个模块将是更好的方法?

It's recommended to reuse the session if possible. 如果可能,建议重用会话。

From the AWS Go SDK docs : 从AWS Go SDK 文档中

Sessions should be cached when possible, because creating a new Session will load all configuration values from the environment, and config files each time the Session is created. 应尽可能缓存会话,因为创建新会话将在每次创建会话时从环境和配置文件中加载所有配置值。 Sharing the Session value across all of your service clients will ensure the configuration is loaded the fewest number of times possible. 在所有服务客户端之间共享会话值将确保加载配置的次数最少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS Lex中的多个会话 - Multiple Sessions in AWS Lex boto3 会话和 aws_session_token 管理 - boto3 sessions and aws_session_token management 多个 ALB 上的单个 AWS WAF - Single AWS WAF on multiple ALB 具有多种服务的 AWS 单一 ApiGateway - AWS single ApiGateway with multiple services 与具有多个实例的AWS ELB跳回会话? - Session Bounced with AWS ELB with multiple instance? 快速会话返回400错误,会话Cookie设置为大型Cookie,仅在AWS Fargate上 - Express-sessions Returns 400 Error With Session Cookie Set With Large Cookies, And Only on AWS Fargate 如何解决我的使用 aws amplify 和 congnito 进行身份验证会话的 Firebase 应用程序中的会话劫持? - How to solve a Session Hijacking in my firebase app which uses aws amplify and congnito for auth sessions? 单个 DynamoDB 流上的多个 AWS Lambda 函数 - Multiple AWS Lambda functions on a Single DynamoDB Stream AWS CodePipeline 将多个存储库作为单一来源进行跟踪 - AWS CodePipeline track multiple repositories as a single source AWS EventBridge 单个事件中的多个目标 - AWS EventBridge multiple targets in single event
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM