Hi everyone!
Flo and I have been making a lot of progress with our app, but things are getting somewhat… challenging
And I would LOVE some guidance and wisdom from the community
TL;DR: What serverless relational database would you choose for an iOS app featuring a following system? And how could I learn it
Our app has both a “solo” use and a “social” use. While Firebase is PERFECT for all the solo features of the app, I’ve realized that it simply won’t do for all the social features
Specifically, we want to build a follow system (a user can follow another user and see their “posts” on a timeline feed)
I’ve found this 10-part article of a guy trying to build a follow model with FireStore. Even though he succeeds, he is clearly against using Firestore for a relational database. Apparently it was just painful to make. So even if I did succeed like him, I’m scared that with Firebase the app won’t scale well and we suddenly end up with a 30,000$ bill because each user requires a gazillion reads and writes for a minute of browsing.
So I’ve looked for a different solution and ended up learning about SQL versus NoSQL databases.
From what I understand, NoSQL basically models data as objects (like JSON and FireStore), whereas SQL models data as matrices (like Excel) which allows for more powerful queries.
For example, I’ve read this type of query is hard in NoSQL but easy in SQL:
SELECT * posts WHERE users/followers == $userId ORDER BY createdAt DESC
Down the road, I also want to decide the order of the posts with an algorithm of my making and not simply by chronological order like the code above, so that’s another important level of complexity to anticipate.
Some possible solutions I found on the internet. Would love to get feedback:
- RedisGraph: the guy who tried to build the follow model on Firebase wrote this article where he apparently managed to combine Firebase and Redis to create the following model. I also found this medium article (slightly outdated, 2013) of a Pinterest engineer who talks about how the built a relational database on Redis.
- SQL Lite: apparently it’s a little old, but it’s well known ?
- How bout Amazon Relational Database Service ?
- Hopefully, you have some suggestions to make
As if things weren’t tricky enough, I do have some important constraints:
- It’s gotta be serverless like Firebase
- It’s gotta be compliant with GDPR & SOC
- It’s gotta be secure, yadda yadda yadda
Ideally I would love to hear from someone who’s tried to build a following model, but I’d be grateful to get input from anyone!
I just need to figure out the right technology for our back-end, and how to learn to use it
Thanks a ton