Explaining distributed systems like I'm five

Michele Riva

MicheleRivaCode

The idea for this talk started during an online course

MicheleRivaCode

The idea for this talk started during an online course

Gabriele

Me

Friends

MicheleRivaCode

What problems do distributed systems solve?

MicheleRivaCode

Create an API that uploads a large CSV file (>10GB) to a server, then read the file, normalize the data, and store it into a database

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

What if we have dozens of concurrent uploads?

MicheleRivaCode

Once we start uploading and processing a few large files, we'll run out of memory

MicheleRivaCode

MicheleRivaCode

The ice cream scenario

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

How do we currently deal with large amounts of people?

MicheleRivaCode

With queues!

MicheleRivaCode

With queues!

But what if there's a *lot* of people?

MicheleRivaCode

We hire a security guard

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

When it comes to software architecture, things gets a bit harder...

MicheleRivaCode

A collection of indipendent computers that appear to its users as one computer

A distributed system is

(Andrew Tanenbaum)

MicheleRivaCode

MicheleRivaCode

  • Computers operate concurrently

MicheleRivaCode

MicheleRivaCode

  • Computers operate concurrently
  • Computers fail independently

MicheleRivaCode

MicheleRivaCode

  • Computers operate concurrently
  • Computers fail independently
  • Computers do not share a global clock

MicheleRivaCode

Source of truth

MicheleRivaCode

Source of truth

Sync request

Sync request

MicheleRivaCode

Source of truth

Time response

Time response

MicheleRivaCode

Source of truth

Time response

Time response

Network time protocol (NTP)

Precision time protocol (PTP)

MicheleRivaCode

  • Computers operate concurrently
  • Computers fail independently
  • Computers do not share a global clock

The solution needs to follow the following rules

MicheleRivaCode

Is uploading a large file to a server a good option?

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

  • Do computers operate concurrently?
  • Do computers fail independently?
  • Do computers share a global clock?

Have we respected the rules?

MicheleRivaCode

So what problems did we solve?

Michele Riva

Senior Software Architect @NearForm

Google Developer Expert

Microsoft MVP

MicheleRivaCode

MicheleRivaCode

MicheleRivaCode

@MicheleRiva

@MicheleRivaCode

/in/MicheleRiva95

www.micheleriva.dev

Explaining distributed systems like I'm five

By Michele Riva

Explaining distributed systems like I'm five

  • 361