0% found this document useful (0 votes)
6 views

mail.google.com-_3

The document provides an overview of key technical concepts including Single Sign-On (SSO), Java Virtual Threads, and a comparison between Redis and Memcached. It also details the Shopify Tech Stack, which supports over 600,000 merchants, highlighting the programming languages, backend technologies, data storage solutions, and DevOps tools used. Additionally, it mentions current hiring opportunities for tech roles.

Uploaded by

Skpatt Tassou
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

mail.google.com-_3

The document provides an overview of key technical concepts including Single Sign-On (SSO), Java Virtual Threads, and a comparison between Redis and Memcached. It also details the Shopify Tech Stack, which supports over 600,000 merchants, highlighting the programming languages, backend technologies, data storage solutions, and DevOps tools used. Additionally, it mentions current hiring opportunities for tech roles.

Uploaded by

Skpatt Tassou
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

EP155: The Shopify Tech Stack

ByteByteGo
Mar 22

This week’s system design refresher:

What is SSO (Single Sign-On)?

How Java Virtual Threads Work?

Redis VS Memcached

The Shopify Tech Stack

Hiring Now: Tech Roles

SPONSOR US

What is SSO (Single Sign-On)?


Basically, Single Sign-On (SSO) is an authentication scheme. It allows a user
to log in to different systems using a single ID.

The diagram below illustrates how SSO works.

1/6
Step 1: A user visits Gmail, or any email service. Gmail finds the user is
not logged in and so redirects them to the SSO authentication server,
which also finds the user is not logged in. As a result, the user is
redirected to the SSO login page, where they enter their login
credentials.

Steps 2-3: The SSO authentication server validates the credentials,


creates the global session for the user, and creates a token.

Steps 4-7: Gmail validates the token in the SSO authentication server.
The authentication server registers the Gmail system, and returns
“valid.” Gmail returns the protected resource to the user.

Step 8: From Gmail, the user navigates to another Google-owned


website, for example, YouTube.

Steps 9-10: YouTube finds the user is not logged in, and then requests
authentication. The SSO authentication server finds the user is already
logged in and returns the token.

2/6
Step 11-14: YouTube validates the token in the SSO authentication
server. The authentication server registers the YouTube system, and
returns “valid.” YouTube returns the protected resource to the user.

The process is complete and the user gets back access to their account.

How Java Virtual Threads Work?


Virtual Threads are lightweight threads introduced in Java 19 (Preview) and
Java 21 (Stable). They allow Java to create millions of threads efficiently,
helping handle concurrent tasks without wasting memory or CPU.

Virtual Threads do not map 1:1 to OS Threads and do not replace the original
Platform Threads. The Platform Threads are backed by the OS Threads and
are sometimes also known as Carrier Threads in this context.

Think of the Platform Threads as a small group of workers, and Virtual


threads as tasks. With Virtual threads, tasks are given to workers only when
needed, allowing one worker to handle thousands of tasks efficiently.

Here’s how Virtual Threads work:

3/6
1. Virtual Threads run on top of Platform Threads. The JVM schedules
them onto a small number of Platform Threads.

2. When a Virtual Thread starts, the JVM assigns it to a normal OS-backed


Platform Thread.

3. Virtual Threads can also handle CPU-intensive work, but their real
advantage is in scenarios with a high number of I/O-bound or
concurrent tasks.

4. If the Virtual Thread performs a blocking operation (like I/O, database


call, sleep, etc.), the JVM unmounts it from the Platform Thread.
However, this does not block the underlying OS Thread as such.

5. The Platform thread is freed up to handle another Virtual Thread.

6. When the blocking operation finishes, the Virtual Thread is rescheduled


on any available Platform thread.

Redis VS Memcached
The diagram below illustrates the key differences.

The advantages of data structures make Redis a good choice for:

4/6
Recording the number of clicks and comments for each post (hash)

Sorting the commented user list and deduping the users (zset)

Caching user behavior history and filtering malicious behaviors (zset,


hash)

Storing boolean information of extremely large data into small space.


For example, login status, membership status. (bitmap)

The Shopify Tech Stack

Shopify is a multi-channel commerce platform for small and medium


businesses. It allows merchants to create a shop and sell products wherever
they want.

Here’s the Shopify Tech Stack, which powers more than 600,000 merchants
and serves 80,000 requests per second during peak traffic.

1. Programming Languages & UI: They use Ruby, Typescript, Lua, and
React

5/6
2. Backend & Servers: They use Ruby on Rails, Nginx, OpenResty, and
GraphQL.

3. Data: They use MySQL, Redis, and Memcached.

4. DevOps: They use GitHub, Docker, Kubernetes, GKE, BuildKite, and


ShipIt. ShipIt has been also made open source.

6/6

You might also like