Today I Learned - Rocky Kev

TIL how Levels.fyi used Google Sheets

POSTED ON:

TAGS:

I love finding creative workarounds to complex problems.

Via How Levels.fyi scaled to millions of users with Google Sheets as a backend

This quote:

Our philosophy to scaling is simple, avoid premature optimization

How does it work?

Write Flow:

Version 0

V0 had no UI, add salary form was a Google Forms UI 😱

LOL, so literally a embedded Google Form. Hell yeah.

Version 1

Our own UI with necessary validations on the frontend

  1. Frontend calls publicly visible API Gateway
  1. API Gateway triggers and spawns a lambda function
  2. Lambda function processes and appends new salary to the sheet

Form does a post request, which sends it to a serverless function.
Then the serverless function adds that data to that Google Sheet.

I LOVE IT.

Read Flow

How does data show up on their website?

Remember that their 'database' is Google Sheets. So they had to do something creative to generate that data.

Our recipe for building a read flow was as follows:

  1. Process data from Google Sheet and create a JSON file
  1. Use AWS Lambda for processing and creating new JSON files
  2. Upsert JSON files on S3
  3. Cache JSON files using a CDN like AWS Cloudfront

Btw, upsert is short for Update and Insert. No I never heard of it until today.

So really, it's literally just turning the Google Sheets into a JSON file using serverless functions, upload it to S3, then use a CDN to handle server load.


Related TILs

Tagged:

TIL Netflix's System Design

Netflix operates in two clouds: Everything that happens after you hit play is handled by Open Connect. Open Connect stores Netflix video in different locations throughout the world. Anything that doesn’t involve serving video is handled in AWS.

TIL how Levels.fyi used Google Sheets

Our philosophy to scaling is simple, avoid premature optimization.

TIL how Levels.fyi used Google Sheets

Our philosophy to scaling is simple, avoid premature optimization.