简体   繁体   English

公交车调度 - 关系数据库或nosql

[英]Buses scheduling - relational database or nosql

I'm trying to store buses schedules into database and I'm wondering which database model is suitable for my case. 我正在尝试将公交时刻表存储到数据库中,我想知道哪种数据库模型适合我的情况。

I have bus operators, each operator has several routes, each route has several turns, each turn has stops, etc. Turns are generated from something called "turn master" where the scheduling is defined (frequency, stops, etc.) within next N days. 我有公交运营商,每个运营商都有几条路线,每条路线有几个转弯,每个转弯都有停靠等。转弯是从一个叫做“转弯主站”的东西产生的,其中定义了调度(频率,停止等)。天。

I expect to deliver a very fast searching for bus when user tries to search a bus from city to city on given date. 当用户在给定日期尝试从一个城市到另一个城市搜索公交车时,我希望能够快速搜索公交车。

I'm using MySQL, the number of stops reach around 100.000 records and the searching speed is fast but I'm not sure if it's still fast when data gets really big (thousand operators, each operator has hundreses turns, each turn has around 10 stops, turns are generated for around next 30 days). 我正在使用MySQL,停止次数达到了大约100.000条记录并且搜索速度很快但是我不确定当数据变得非常大时它是否仍然很快(每个运营商有几千个运营商,每个转弯大约有10个停止,在接下来的30天左右产生转弯)。

Basically, performing a search is to look into stops (city/town/place, time) and check if it matches user search criteria. 基本上,执行搜索是查看停靠点(城市/城镇/地点,时间)并检查它是否与用户搜索条件匹配。

So, my question is: Is relational database best in this case? 所以,我的问题是:关系数据库在这种情况下最好吗? Or using some kind of NoSQL will be better when the data get really bigs? 或者当数据变得非常大时,使用某种NoSQL会更好?

Thanks in advance, 提前致谢,

NoSQL databases are designed to work with unstructured data or data which is structured in various or unpredictable ways. NoSQL数据库旨在处理以各种或不可预测的方式构造的非结构化数据或数据。 Your data is structured in a very well understood and predictable way. 您的数据以非常好理解和可预测的方式构建。

What makes you think that relational database isn't the right answer for your application? 是什么让您认为关系数据库不是您的应用程序的正确答案? Having a lot of rows doesn't mean your relational queries are going to be slow. 拥有大量行并不意味着您的关系查询会变慢。 The performance of your application will depend on having proper indexing, but even more importantly, it will depend on your application logic. 应用程序的性能取决于具有适当的索引,但更重要的是,它将取决于您的应用程序逻辑。 What heuristic are you using for solving the travelling salesman problem? 您使用什么启发式来解决旅行商问题? How you do your routing could potentially have a bigger impact on system performance than your data storage choices. 与数据存储选择相比,如何进行路由可能会对系统性能产生更大的影响。

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

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