简体   繁体   English

关系数据库与非关系数据库-运动结果和架构

[英]Relational vs Non-Relational Database - Sporting Results & Schema

I'm looking to consolidate a number of historical sporting results in a database which will allow me to query them for the future purpose of building apps and visualisations. 我希望将许多历史体育比赛结果合并到一个数据库中,这将使我可以查询它们,以用于将来构建应用程序和可视化的目的。

My understanding of this area leads me to believe I could be taking a non-relational approach (Such as Amazon's DynamoDB) so that I don't have to take database resource, size etc into consideration as the size of the data, and the querying of it, grows. 我对这方面的理解使我相信我可以采用非关系方法(例如Amazon的DynamoDB),这样我就不必考虑数据库资源,大小等作为数据大小和查询的考虑因素。增长。

I then have plans to use Amazon Lambda to handle the import of data and handle responses to incoming queries. 然后,我计划使用Amazon Lambda处理数据导入并处理对传入查询的响应。

My two questions are: 我的两个问题是:

  • Is this valid approach? 这是有效的方法吗?
  • What would a non-relational schema look like? 非关系模式是什么样的?

To help context the second question, if this was a relational database the tables would look something like this. 为了帮助解决第二个问题,如果这是一个关系数据库,则表将看起来像这样。

  • Events 大事记
  • Races (Where a result and associated fields are stored) 竞赛(存储结果和相关字段的位置)
  • Athletes 运动员
  • Teams 队伍

If your query will have lots of joining to those tables, relational db will be preferred. 如果您的查询将有很多联接到这些表,则关系数据库将是首选。 Although it's possible to use DynamoDB, you'll have a hard time in joining those tables. 尽管可以使用DynamoDB,但在连接这些表时会遇到困难。 The feature of DynamoDB that can make it hard for developers is the indexing. 索引编制是DynamoDB的一个使开发人员感到困难的功能。 you have to search with the hash key. 您必须使用哈希键进行搜索。 So you have to be careful in choosing the index. 因此,在选择索引时必须小心。

However, if the data is just like a lookup, eg race ID 123, winner is Athlete A. DynamoDB would thrive as there are advantages of using it (scalability, minimal management, etc) 但是,如果数据像查找一样,例如种族ID 123,则获胜者是运动员A。DynamoDB会蓬勃发展,因为使用它有很多优势(可扩展性,最低限度的管理等)

Personally, I don't like dynamoDB when listing something (using search, pagination, etc) You can build a search index of course but for simpler application, it would be an overkill. 就个人而言,我在列出某些内容(使用搜索,分页等)时不喜欢dynamoDB。您当然可以构建搜索索引,但是对于更简单的应用程序来说,这太过分了。

ALTERNATIVE 替代

if you are only interested in building the visualization and aggregation of the data, you can use redshift or S3 to store the data. 如果仅对构建数据的可视化和聚集感兴趣,则可以使用redshift或S3来存储数据。 And run some aggregation function later on. 稍后再运行一些聚合功能。 Then save the aggregation into the dynamodb or rds. 然后将聚合保存到dynamodb或rds中。

I consider dynamodb and RDS databases for data which are queried by end users only and use. 我认为dynamodb和RDS数据库只供最终用户查询和使用。

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

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