4 ms·
Please help me with my Database choice
I am planning to make an mobile app (no web apps) for ios and android. It is a flashcard app and I am going to use swiftui and kotlin.
The flashcards are around a million in number, organised into 19 subjects, 5-10sections each, 10-20chapters under each section and several subtopics under each chapter.
An user will study daily from multiple chapters and subtopics from various subjects. I need to store that data and use it to run a spaced repetition algorithm and give dailycards for review. this will help them achieve spaced recall for effective memory. I may achieve 50,000 MAUs soon after launch. In future I will also be adding question banks to the app.
I am confused about going with mongo + realm or postgres + sqllite. Please help me choose. My users will be primarily from asia.
- jruohonen 3y ago> The flashcards are around a million in number, organised into 19 subjects, 5-10sections each, 10-20chapters under each section and several subtopics under each chapter. I am not sure whether Sqlite scales, but that would be my first suggestion.
- brudgers 3y agoIt doesn't matter. Stop planning and start building. Then solve the problems one at a time when they matter. Good luck.
- appalam 3y agoThanks for the advice. WIll try to build the MVP asap.
- leros 3y ago50k users accessing 1M records is actually not a very big number from a scaling point of view. Use whatever tech you know best and feel more comfortable using.
- appalam 3y agoThank you for the comment. Firebase is gonna be my choice I just have one concern though, the user will be interacting heavily with the flashcards while studing and I want to store that info for the algo. Should i go with an on-device database for it? or Firestore can handle it?
- leros 3y agoIf you can query for the flashcards once and save it on device, that would cut down your reads quite a bit and make your app work offline.
- fragmede 3y agoJust use Firebase and be done with it, and half the other steps it takes to build an app. For what you're describing, database operations isn't going to be a core competency or product differentiator, so it doesn't make sense to spend any more time on it than necessary.
- appalam 3y agoThat's true. The users have a high motivation and a lack of resources, so they wouldn't worry about app size or installing the app. However, the UI has to be friendly and non-fatiguing. As you said, I will focus on the frontend now and use firebase to avoid complications in the backend. I just have one concern though, the user will be interacting heavily with the flashcards while studing and I want to store that info for the algo. Should i go with an on-device database for it? or Firestore can handle it?
- gtirloni 3y agoPostgreSQL (+PgBouncer) will be more than enough and actually can reach higher transaction numbers than MongoDB since I doubt you need horizontal scaling for such workload. It has the added benefit of doing a lot for you. With MongoDB you'll need app logic to do certain things. MongoDB improved ACID support but it's not as smooth as just starting PostgreSQL and use it right away. But that all doesn't matter. Pick what you're comfortable with.
- appalam 3y agoThank you for the reply. From other comments, I have decided to go with Firestore because that's faster and I am comfortable with it too. I just have one concern though, the user will be interacting heavily with the flashcards while studing and I want to store that info for the algo. Should i go with an on-device database for it? or Firestore can handle it?
- lgkk 3y agoUse firebase firestore. Use firebase auth. Ship your app (checks watch) by tonight. Good luck! Sounds like a cool app.
- appalam 3y agoThank you veryyyy much. I am doing it solo and I am not a CS major. This comment made my day! I just have one concern though, the user will be interacting heavily with the flashcards while studing and I want to store that info for the algo. Should i go with an on-device database for it? or Firestore can handle it?
- lgkk 3y agoYeah. And firestore is real-time so you could do some cool stuff with that. Try their sdk out it’s really easy.