I'm very new to cloud data management and to be honest, I don't even know where to start looking! So please be patient if I get some terminologies wrong.
I am working on a flutter app that the users can check the bus schedule and prices. The users can select the origin, destination and time to search the timetable. The response should be something similar to the example in the picture below.
The timetable looks something like this:
Stops | Stop A | Stop B | Stop C | Stop D | ... Bus 1 | 10:00 | 11:00 | 11:30 | 13:00 | ... Bus 2 | 11:00 | - | 12:30 | 14:00 | ...
The requirements are:
- The users can get on and get off at any stop.
- The time it takes from one stop to another can vary depending on traffic
- The buses don't always stop at every stop
- Depending on where you get on and off, prices do vary. (A->B can cost differently to C->D)
- Buses can go in both directions. (A->B->C->D and D->C->B->A)
So my question is, how should I structure the backend cloud database? The ideal solution would be something that's can be easily scaled and modifying/adding bus routes would not be too painful.
Here's what I have looked into:
- Google Firestore noSQL: This seems like a good solution because of the flexibility, but I do not know how to properly structure the database and it can potentially gets messy?
- mySQL: Since the data structure won't changed this is also an attractive solution. But because the buses don't stop at every stops, again I'm unsure about this.
- Maybe create some sort of web API?
Recommendations on how to do this would be greatly appreciated! Thanks you so much in advanced.