Coursera

AWS Case Study of Coursera

Nithish Kumar
4 min readJun 29, 2023

About Coursera:

✨Coursera is the world’s largest provider of massive open online classes (MOOC). It has more than 150 university partners from 29 countries and more than 25 million registered students. To Host its website and support, Coursera relies heavily on Amazon Web Services (AWS).

💁Which Services Coursera using for hosting their website ??

>> Coursera website is a single page application written in JavaScript and it is hosted on Amazon Simple Service Storage (AWS S3) and served using CloudFront. Previously they used EC2 instances for launching Jenkins Servers to build their applications and at present they are using AWS Code Build.

>> Docker Containers on AWS ECS enabled Coursera to easily move to micro services based architecture. And they use AWS ECR to upload customized docker image with all dependencies installed, so that they can test the application seamlessly and fast. CloudFront is used to provide globally distributed network of proxy servers to cache content. So that consumers can access the content (web videos) fast.

🤔Let’s discuss challenges faced by Coursera

>> Coursera is Challenged by limited Build Capacity. To build and deploy its application, Coursera used 8 Jenkins machines running on AWS EC2 service. Whenever a change was committed to GitHub, it would trigger Jenkins to build Javascript code and upload/host it on AWS S3.

>> This process worked for a while. But day to day their application code grew (by adding new features), build time starts taking long time. Previously, application were deployed as a single Monolithic Build. A problem with one application would stop deployment of entire application. To improve build, it broke up its monolithic application into 50 individual applications containing different parts of website. Now they can build and deploy separately.

>> So, if anytime they need to build entire application, they need to start 50 different Jenkins jobs to build all individual applications. However they don’t have sufficient capacity to run 50 jobs at once. So jobs queue up and take long time to build entire application.

“We were looking for a solution that would allow us to run jobs in parallel. So we wouldn’t need to wait for a job to finish to run the next one.” says Kane (one of the senior Engineer in Coursera.)

Solution is

Code Build

What is Code Build and How they using it …

>> Code Build: It is a fully managed continuous integration service that compiles source code, run tests and produces ready-to-deploy software packages. Now company started using AWS Code Build for compiling source code which is JavaScript and run tests and produced software packages. And these Software packages deploy on production environment using AWS ECS.

>> Along with all these things, coursera started using a custom build environment. Like instead standard Node.js containers for its build, it uses AWS code build to create a sperate Docker Image which includes all required Javascript dependencies as cache. Now that image is pushed to AWS ECR (Elastic Container Registry) and take it refernce for further builds.

>> Now to build a application, all they need to do is to retrieve docker image from AWS container registry, run the scripts which is committed on GitHub, and upload/host it to Amazon S3.

Advantages using Code Build

>> Increased Speed: With AWS Code Build, building an application now takes about 10 minutes.

“ To get same performance on Jenkins would cost four times as much because we would need to spin up 50 Jenkins EC2 Instances to have builds finish that quickly” says Kane.

>> Scalability: On Average, company runs 300–500 builds each day using AWS Code Build, and because the service scales continuously and processes multiple builds in parallel, builds are not left waiting in queue.

“If we needed to run 70 builds all at once, we could do so.” says Kane.

>> Cost Saving: Before using AWS Code Build, company using Jenkins which is running on EC2 instances to build its application. The Jenkins instances were spun up each morning and sat idle until there was a job. Here instances are keep on running for idle which will end up with a huge cost.

>> So in AWS Code Build, when new code came it starts build and cost is calculated for build time, so they end up with a small cost compared to running instances for whole day.

“Next, we’re going to add some of our backend services to AWS Code build and see what that looks like” added Kane.

That’s all guys, See U in next blog.

…Signing Off…

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Nithish Kumar
Nithish Kumar

Written by Nithish Kumar

Aspiring DevOps/Cloud Engineer. #Believe in you.

No responses yet