Hacker News new | past | comments | ask | show | jobs | submit login

If Khan Academy uses Youtube to serve their video and uses Fastly to serve static content, what makes it hard to scale ?

I mean being able to scale that easily is a great thing, but is there anything worth sharing with the world in their case ?




I need to write a blog post about this :)

A lot of people seem to think of Khan Academy as a bunch of videos. Many have also seen the exercises and articles. Those things are all pretty static (though it gets more complex when you consider how much content there is and how many languages it's localized into).

There's a whole bunch of dynamic behavior around that static content. Keeping track of progress to tell a learner how they're doing, plus to help recommend the next place to go in the content. Reporting on progress to parents and teachers. Letting teachers create assignments and manage their classrooms. Bubbling up information to school districts.

Content pages have discussions and clarifications. There are notifications to tell students about new assignments, for example.

There are connections to tests, like the SAT prep or integration with the MAP test, which involve connecting our accounts with external accounts in order to help students based on those test results.

And a bunch of other stuff that isn't coming to mind right now because I'm just naming things off the top of my head.

Doing all these things across a user base of millions of monthly users can get quite involved.


Thank you! I'm curious what the cost was to run this stack for one month?

In the blog post Marta said:

> In the month of April, we served 30 million learners on our platform

How much did it cost to run this whole stack on GCP in April 2020? Was it $150,000? More or less?


Unfortunately, I don't think I've seen this publicly reported and I'm not in a position to decide to make that public.

I will say that the amount we pay for our infrastructure, especially right now, is reduced by generous support from both Fastly and Google. It still remains a substantial expense after that support.

One final note on cost: we are actively working on a Python to Go transition[1] that will reduce our hosting costs, among other benefits.

[1]: http://engineering.khanacademy.org/posts/goliath.htm


Yes. In this case, they share the fact they used common sense. This is not saying that all of the other major re-architecture blog posts are flawed. However, it is good to know that scaling when using cloud vendor specific tools is as easy as advertised.


Yes, for the same reason that researchers should publish null results: all of the data is useful. Getting confirmation that a particular formulation of a strategy works or does not work is valuable in and of itself, regardless of the exact outcome. The only reason why it wouldn't be valuable would be if there were a plethora of similar reports of successfully scaling this solution, which I do not, so their experience is very welcome.

To turn it around, why would you ever want someone to not share their experience with the world if they took time to write it down? It's not like you must read it; it doesn't cost you anything to exist. But if someone's experience adds to the library of human knowledge, even a little bit, why would one try to reject that?


"How to scale: Make it somebody else's problem."


A surprisingly legitimate solution.


Yes, with the caveat that you may have to check that they're actually capable of handling the load and you don't get a surprise notice that "uh we can't do this, you're on your own".


I am pretty confident that YouTube will be able to scale to handle any increased load coming from my service.


But they might not at any time, at least without charging. With an apparent internal push for some services to become self-sustaining (see Google Maps API, Recaptcha), YouTube embeds might be next.


Khan Academy today supports serving video outside of YouTube, which is blocked in some schools. We could essentially flip a switch to not use YouTube, but the cost would be substantial because those videos go Fastly->S3, so anything not in cache is going to result in S3 egress charges.


Something to consider in your tooling for this is to target Backblaze's B2 object store, which supports an S3 compatibility layer [1] (so you shouldn't need to change too much code). I'm unsure if Fastly supports B2 in this configuration yet though.

[1] https://news.ycombinator.com/item?id=23069114


Yeah, I'm sure that if we needed to serve more videos through our "fallback player", we'd investigate more cost effective ways to run it. With thousands of videos, it'd be a pain to move … but at least that would be a one time pain!


Something else that can also help cost and quality is EasyBroadcast’s viewer assisted streaming in addition to Fastly. Adding a JS to the player pages enables cdn offloading by making each viewer act as a potential source based on QoE/QoS metrics. Disclaimer: I am one of the cofounders. Happy to help.


It seems unlikely Khan Academy doesn't have the technical competency to deploy their video content to an alternate host rapidly, whether that be an object store (Backblaze) or dedicated servers with very cheap bandwidth (Hetzner, OVH, and similar), perhaps even using PeerTube.

There's a reason other non profits like Wikipedia and the Internet Archive run their own hardware, networking, and connectivity to transit providers. And before the "doing that is expensive!" argument comes up, note how expensive having someone else do these things are. Lots of margin built into cloud services.


I am loosely involved with one of the language teams. This language team, and others like it, are groups of volunteers and not Kahn Academy employees. I don't have all the details but I know that the teams are responsible for creating the content and uploading the content to youtube. Changing to an alternate host would require more coordination than you might think.

My contribution is that I am helping with automating video uploads to the team youtube channel, which is allowed to have "Kahn Academy {language}" branding.

Shameless plug: If any google or youtube employees can help me raise our API quota please get in touch!!! :)


They can. Doesn't mean they will.


Or a bill, please pay one million.

Kthxby


"And give them bookoo $$$ to do so."


Which is usually known in the industry as "good problems to have." If you're staring down a huge bill because your company is blowing up you pay it, throw a party, and then figure out how to reduce costs once the hangover wears off.


I'd rename it to "pay someone else to do it". In the case of YouTube, even if the hosting is free, YT still makes a profit (ads, tracking, etc.) so it's a win-win for all.


Or, to phrase it differently: their technical problem, your financial problem.


There's quite a bit of dynamic content, no? Things like exercise grading, and progression through the skill tree.


Which is powered by Google's AppEngine, which scales very easily, at least technically easily.


s/easily/expensively/

Khan Academy doesn't have infinite money.


what makes GAE expensive?


Anything is expensive if you have to scale up beyond your financial ability to do so.


Not sure why you’re being downvoted. Scaling systems at companies with a lot of money is very different from designing system to be reliable and performant and with reducing spend being a real goal.

Some companies need to take a much harder look at their spend than others regardless of where you deploy.


"Just use external video hosting and deploy CDN for static" sounds like a trivial advice, but I constantly see businesses here and there not following it. So, as it says in Russsian proverb, "repetition is a mother of learning".


I'd like to hear engineering stories from Youtube in that case. What does their operation look like? Do they ever tell?


Make an educated guess about the design of youtubes serving infrastructure, and I'm pretty certain you're right.

There's only really one sensible way to do it, and that's the way it's done.


That's not terribly helpful to a large portion of people that don't have the requisite knowledge or experience to make an educated guess, or don't have the knowledge to eliminate most of a few educated guesses.

It's sort of like someone asking how you rebuild the stock carburetor on a 1967 Mustang, and replying "Make an educated guess about the design of youtubes serving infrastructure, and I'm pretty certain you're right." For the vast majority of people, that's no use at all.


Like the rest of the system that isn't just videos and static content?


It's a cookie cutter app engine stack which scales automatically




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: