by andremedeiros · 3y ago · 0 comments
A gentle reminder that the whole history is here for show. This is very vulnerable — you can see the times I was in a rush, or when I took my time. You’ll find my mistakes. Either way, all I ask is please be kind. I know there are 50 things I could have done better, but this is a product of the reality at the time — a balance between something that works and something that was cost effective for Christian.
When I first started coding (some 15 years ago) I wrote the ugliest, buggiest and "owasp-ridden-est" PHP spaghetti code. Turns out that code went viral and was used by millions of users for a few years.
Yet, I came to the conclusion that that's the best code I've ever written, for it's been the most used code I released so far.
Real software development is far different than the ideal one.
User rapnie mentioned the code in the repository doesn't have a license [0]. You might want to review that.
1. All rights reserved - the source is visible but not open.
2. AGPL, to ensure that if someone does take this forward, no part of it can be closed source without your agreement.
3. MIT, which is extremely permissive and effectively you don't care what someone does with it, commercial or not.
Depending on your comfort level I would start with the middle option, I don't think people tend to mind you re-licensing more liberally but if a community has formed and you decide to go commercial further down the road it can cause problems.
Gives those who wish to learn and stops from anything taking the future glory.
I wouldn’t add a license unless you specifically want to allow people to copy and use this code, otherwise just ensure that the appropriate copyright notice is present. No license is better than a badly written or badly chosen license — no license already means that all rights are reserved and no rights are given.
GPL on server side software doesn't really matter, that is why the AGPL exists
Some of the 'code' running massively profitable departments in finance are spreadsheets, on shared drives, with thousands of linked cells thought up by a brilliant employee who left the company five or six years in the past.
I wish I was kidding.
Thanks for how great you kept apollo.
Show HN is always really close to to that ideal. One of the reasons I like this place.
Christian is very visible in the community, but I want to say thank you to you too.
Thank you for all the work you did! This made a lot of our experiences great.
It’s just people talking around a topic and helping each other. Subreddit mods doing everything they can to keep their area clean for people reading. I’ve been on Reddit over for over a decade and this is the power behind it. Just wanting to help and bring good member.
Thank you Andre. For your work and commitment to Christian, Apollo, and the community.
Do you think Christian would be willing to open source the app (under a non-commercial license) and allow us to build it with our own Reddit API keys?
That way we could still use Apollo, but pay for it ourselves
I doubt reddit had any actual issues other than it impacting profits and no optimization to Apollo would fix it.
The TLDR here is that we only ever requested new notifications (give me anything that came after this thing I know about), which funnily enough then broke for some users, because if a reply you got notified about gets deleted and you use it for reference, Reddit will never return anything new to you, so I had to go and write a 2nd service that runs much more infrequently but does some checks on each account to make sure this isn’t the case.
If Apollo's users (or a good percentage of them) moved over to an alternative platform, that would be poetic justice, at least.
To go even further, all the app devs should get together and create a new platform or pick one Reddit alternative and point all their apps at it.
That way it would be even more likely to get critical mass quickly. 3 weeks should be enough time to come up with a coordinated plan. Don't let Reddit push you out -- push them out and let your users stick with the app they love.
Reddit is only its users, nothing else. They don't own the users' loyalty -- the apps do. Take advantage of that and teach them a lesson by pointing the apps and users elsewhere!
Most would hate to see what a sausage gets made out of, but nearly everyone will eat that same sausage.
Especially when you're solo or on a small team, technical debt is actually something you can lean into. In this domain, refactoring is cheap and cutting corners can help you get where you need to go faster.
It's a too common mistake to think that because technical debt is a tar pit that kills many large products that this is universally true. The real trick is lowering the tolerance for flaws as the project grows and matures.
Sample of latest commit messages:
batch size wants to be smaller for less locking time, not higher
increase scheduler batch size
bump locks again
make pool sizes customized
increase prefetch
[skip render] remove old redis from infra
increase poolsize a bit
bring new redis up to line in blueprints
reduce pool size
bump pg client count
tweak pool sizes and consumer count
double the amount of consumers
small tweaks
[ci skip] update pgbouncer github url
clean allow lists
add new redis instances
make connections to the correct redis url envs
add new env variables
spam prevention
update reddit http client
feat(ops): add distributed tracing (#109)
The way I took Reddit's comments were there were things that could be optimised to reduce costs. I've not seen a codebase yet where that isn't true.
Sadly, in the hands of Redditors who think you can host an API on AWS for $1 per million requests comments like come across as "Oh they did shoddy work".
What I think is we're seeing production quality code like the majority of us have running.
A payload of 25 comments vs a payload of 100, takes less time to generate and deliver.
So sometimes, to optimize his users experience, he might request 25 to show something quick to the user and then do a request for 100 and append it.
He also mentioned that he’s being compared to other apps, _not_ to the API limit (which he was under anyway).
So, can it be less?, of course. Heck, he could make it 1/minute or even 1/day. But his quota was 60/min. So why not use the 60?.
As far as the app goes, an average of ~330 reqs/user/day is pretty good, considering they built the platform budgeting for 86,400.
If there’s an issue with the cost to process that many calls I’m much more suspicious of inefficiency on the API side than the client. Those numbers seem very reasonable.
I don't think Reddit cares about the number of requests. They just want paid. They weren't caring before when it was free.
Apollo saved my Reddit use after they bought and killed Alien Blue. I have gotten so much out of and out so much into the more obscure technology subreddits. It’ll be missed.
I appreciate all your work. For what it’s worth, I’ve never had server-side issues with Apollo (that I’ve noticed anyway!)
Edit: typo
IMHO the gesture of releasing the code shows how much integrity there is behind the devs, and I could care less if there's not-best-practice in there.
I am waiting on delivery of an iPad pro, my first apple device in 10 years. And, even though I hate reddit, I was excited to check out Apollo, if for no other reason than to see what a great ios app looks like.
I know that reimplementing reddit API from scratch will take more than a few weeks. But, I'm sure loyal Apollo users will be happy with a much scaled-down version. Maybe, to begin with you put the app in Read Only mode, and point it to a reddit archive. Then work on making one sub read/write again and expand from there.
I mean, even just a good reddit archive browser has TONS of value. I'd happily pay a small sum for an awesome reddit archive explorer.
"Chatgpt, build the back end for this API: $(cat reddit_api_docs)"
How was the experience overall with this tool? If you have experience with Flyway, how does it compare?
Also, thank you for making this code available, but would it be possible for you and Christian to choose a license for it so people can use it? I don't think which license matters all that much, personally, but I can also understand wanting to keep it proprietary, either way, thank you again for all your (and the rest of the Apollo teams') work.
The one fun thing I learned was about databases. Given enough records, a query planner might decide to start doing things very differently and you will get woken up at 3am with a CPU usage alert. That was a fun one to debug for sure…
Thank you.
Would love to have a decent client for this site…