My favorite pet example of this is the follow button architecture (you better read this because itâs an example of what we hide from you to save you time):
Okay, itâs just a fucking button, you click on it and it inserts a row in the follows table and it changes color, right?
Well:
* What does the button do if the user isnât logged in? Does it redirect to the login page or silently fail? Does the login page have a mechanism to take you back to the same page the user started from when they first clicked follow? Should they have to click follow again or should the app somehow remember and automatically follow them when theyâre logged in?
* What if the user is banned? Can they still follow people if their account is disabled?
* Do we notify the other user they just got followed? How? Do we send an email? Do we have an SMTP server? Do we use a mail SaaS? Is our domain blacklisted on spam lists? Do we do push notifications? Are we collecting APNS tokens? Oh, for Android we need a Firebase project. Are we using Firebase? No? Fuck, we need procurement to approve it. Iâll put a ticket in
* What if a user follows someone on one page but they have 7 different tabs of our app open? Should we do some kind of real time updating system to apply it across their tabs and devices? Do we use WebSockets? SSE? How do we scale that up to 100,000 DAU?
* What if you follow a user and they block you? Do we delete their follow relationship (soft block), or do we show you a blocked page if you try to visit their profile?
* What if YOU block them? Does it unfollow them? Or do you still get their content in their feed?
* Do we show any special labels for mutuals? So on every page load we have to retrieve all your follows and then join that table with all of THEIR follows to find intersections. Hopefully thatâs a fast query. Maybe we index this? Maybe we have a cron job run every hour to dump your mutuals into a separate table
* Etc etc. I have to go to dinner so Iâll stop typing. But what I would say here is:
âOh yeah, follow button, should be easy, just a button and another table, should have it ready by tomorrowâ