简体   繁体   English

共享资源文件的存储位置

[英]Where to store shared resources files

We have 2 nodejs apps (on 2 different servers) that use same resources (some json files). 我们有2个nodejs应用程序(在2个不同的服务器上),它们使用相同的资源(一些json文件)。 We need to access those shared files from the applications code . 我们需要从应用程序代码访问那些共享文件。 That's why we want to move them out. 这就是为什么我们要将它们移出。

What is the correct way to do that? 正确的方法是什么? Is this architecturally correct? 这在结构上正确吗?

  1. SFTP server? SFTP服务器?
  2. S3? S3?
  3. Other option? 其他选择?

We use AWS cloud. 我们使用AWS云。

You can use s3 bucket for storing the file. 您可以使用s3存储桶来存储文件。 I kind of did a project where we had two nodejs application where we had to provide a kind of key to both apps which was then hosted on s3 and retrieved when needed. 我做了一个项目,我们有两个nodejs应用程序,我们必须为这两个应用程序提供一种密钥,然后将其托管在s3上并在需要时进行检索。 You can also do this locally is you are hosting both node apps on a single machine 您也可以在本地执行此操作,因为您将两个节点应用程序托管在一台计算机上

The easiest option by far is S3. 到目前为止,最简单的选择是S3。 An alternative would be to create an EFS filesystem and mount it on both servers. 一种替代方法是创建一个EFS文件系统并将其安装在两个服务器上。

Options: EFS - mount a file system; 选项:EFS-挂载文件系统; S3 - store as objects in shared bucket; S3-作为对象存储在共享存储桶中; DynamoDB - store json as documents in NoSQL DB. DynamoDB-将JSON作为文档存储在NoSQL DB中。 You didn't mention, but I assume you're running on an EC2 fleet and not going serverless, so S3 or dynamo would be good choices -- you can provide security by limiting permissions with EC2-assigned IAM roles. 您没有提到,但是我认为您正在运行在EC2机群上并且不会无服务器运行,因此S3或dynamo将是不错的选择-您可以通过限制EC2分配的IAM角色的权限来提供安全性。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM