存储和搜索股票符号的AWS架构 – Elasticsearch或DynamoDB

huangapple go评论90阅读模式
英文:

Store and Search Stock Symbols AWS Architecture - Elasticsearch or DynamoDB

问题

我有一个外部API,用于同步所有市场(NASDAQ、NYSE等)的股票符号。
我有一个AWS Lambda函数,用于从外部API获取这些数据。

然后,我想要一个前端网站,带有一个搜索栏,用户可以输入“Tes”,然后应该自动出现一些建议,就像“Tesla”或“TESO”或以“Tes”开头的其他公司一样。

我的疑问在于后端。我应该将这些符号存储在DynamoDB还是Elasticsearch中?
您是否了解另一种更适合此情况的AWS服务?

我在考虑将其存储在DynamoDB中,以符号作为主键,但然后我们无法进行全文扫描以按“Tes”进行搜索。对于Elasticsearch,我没有经验。

英文:

I have an external API to synchronize all the Stock Symbols from all markets (NASDAQ, NYSE...).
I have an AWS Lambda to get this data from the external API.

Then I want a frontend website with a search bar, where the user can type "Tes" and it should appear automatically some suggestions, just like "Tesla" or "TESO" or other companies starting with "Tes".

My doubt is in Backend. Where should I store these symbols? in DynamoDB or ElasticSearch?
Do you know of another AWS service that is better suited for this scenario?

I was thinking in store in DynamoDb, using the symbol as Primary Key, but then we cannot search by "Tes" without a full scan. With Elasticsearch I don't have experience.

答案1

得分: 2

Opensearch 是您所需的,现在也支持无服务器,这使其非常适合无服务器架构。使用 DynamoDB 流,您可以轻松地将数据流入 Opensearch。查看代码指南:

https://docs.aws.amazon.com/opensearch-service/latest/developerguide/integrations.html

以及此工作坊将为您提供成功所需的必要信息和工具。

英文:

Opensearch is what you need, which is also serverless now which makes it a good fit for serverless architectures. Using DynamoDB streams, you can easily stream data into OpenSearch. Code pointers here:

https://docs.aws.amazon.com/opensearch-service/latest/developerguide/integrations.html

And this workshop will provide you with the necessary information and tools to be successful.

答案2

得分: -1

对于临时数据,请考虑使用 AWS ElastiCache。它是在Redis或Memcached之上运行的键值存储。您可以将符号用作键,并将运行中的股票价格存储为值。

英文:

For transient data, consider using AWS ElastiCache. It's a key value store that runs on top of Redis or Memcached. You can use the symbol as key and store the running stock price as value.

答案3

得分: -1

如果您愿意考虑非AWS服务,我建议使用Typesense或Meilisearch。它们在这种用例下比Elasticsearch要好得多。

英文:

If you are open to non AWS services, I would recommend typesense of meilisearch. They are much better products for this use case than Elasticsearh is.

huangapple
  • 本文由 发表于 2023年6月1日 21:57:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76382677.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定