I'm going to log here my journey learning more about distributed systems. #LearnInPublic

First of all, let's start with an introduction to that theme!

In a single-computer, concurrency is known as shared-memory concurrency as multiple threads can access the same memory space.
In a distributed system, concurrency still exists as different computers can execute programs in parallel. However, shared memory is not typically present. Each computer in a distributed system has its own operating system and address space, and nodes communicate with each other.
They communicate by sending messages over a network. Databases can be thought of as shared memory, but with a different data model. Each computer in a distributed system is called a node, which can be any type of communicating computing device.
Another reason for using distributed systems is for better performance.

If a service has users all over the world and they all have to access a single node, it can lead to slow performance. By placing nodes in multiple locations, we can route users to nearby nodes.
Some large-scale tasks are too big or slow to be performed on a single computer. For example, the Large Hadron Collider has a worldwide computing infrastructure with 1 million CPU cores and 1 exabyte of storage.
Why make a system distributed? TL;DR

> It’s already distributed:
When you send a message to your friend, we have at least two devices involved.

> For better reliability:
Even if one node fails, the system as a whole keeps
functioning
> For better performance:
Get data from a nearby node rather than one halfway
round the world

> To solve bigger problems:
Huge amounts of data, can’t fit on a single machine
However, there are also downsides to distributed systems, because things can go wrong, and the
system needs to deal with such faults. The network may fail, leaving the nodes unable to communicate.

In distributed systems, nodes may crash, run slow, or misbehave in some way.
To handle these situations, we need to detect when a node has crashed and another node take over. However, network and node failures can happen without warning, making detection difficult. In a single computer, if a component fails, the computer will likely crash.
In a distributed system, we need to design for resilience and handle failures gracefully.

In a single computer, the software doesn't need to be written to explicitly handle faulty RAM. However, in a distributed system, we often want to tolerate partial failures.
If a component in a system stops working, it is called a fault. Distributed systems try to provide fault tolerance, meaning the system continues to function despite the fault.
Handling faults is what makes distributed computing fundamentally different and often more challenging than programming a single computer.
Why NOT make a system distributed? TL;DR

Communication: may fail (and we might not even know it
has failed).

Processes may: crash (and we might not know).

Fault tolerance: we want the system as a whole to continue working, even when some parts are faulty.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with nicolas lopes

nicolas lopes Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @nicolaslopess__

Dec 11
Sometimes when you're building a design system or generic components, it can be frustrating when you don't know what the default style/behavior should be. My advice: even if you're unsure, create the simplest possible version and try to find patterns as you use it.
For example, I was building an app to track my diet/workout routine and I couldn't figure out what color the title, subtitle, and text should be. But as I continued building, I realized I had subconsciously created a pattern.
The main key is to break the process into simple iterations:

- Define what needs to be done
- Create a solution
- Identify what can be reusable and break it into small building blocks
- Make Those building blocks reliable and really good
Read 7 tweets
Oct 23
let's suppose you're building a hook to use your forms easily and you've opted to receive an argument with their default state, i.e:

useForm(INITIAL_STATE)
then, you want to get their types and give handy type completion for your mutate method, what you would do?
cc @sseraphini
you probably thought about using the `keyof` keyword, right?

so, let's try! it looks like it worked! we're getting exactly the keys of the object that we've passed!

forms aren't only objects...what if another developer on your team gives an array as the default value?
oof 😮‍💨, we're getting all the array methods because we are getting the keys of the array, not the object you've passed properly! so, wtf? can I do a conditional type with typescript? Yes!!!!! you can!
Read 9 tweets
Oct 20
do you know how to prove that EVERY truth table has 2ˆn lines?

you can prove that with a concept called `Weak Induction`.

first of all, you're maybe thinking that oh:

if I have 1 column, the table has 2 lines
T(1) = 2ˆ1 = 2
the same with two
T(2) = 2ˆ2 = 4

cc @sseraphini
but you can't say this is applied to all the natural numbers just by looking at a small portion of them. actually with data and literal numbers you can't prove anything that is contained to the natural numbers set.
i.e (n e N)

so, how we can prove this for EVERY natural number?
well, we'll use a mathematical concept called `Weak Induction`.

first of all, let's define the base case
P(1) = 2ˆ1 = 2, we know this is true.

then let's suppose that P(k) = 2^k, this is our induction hypothesis.
if p(k) is true and p(k + 1) is true, we prove!
Read 5 tweets
Oct 19
i'm getting an error while trying to set up a monorepo w/ @turborepo and @stitchesjs.

i'm trying to create my design-system package, but getting this error:
The type of this node cannot be serialized because its property '[$$PropertyValue]' cannot be serialized.
cc @sseraphini
my tsconfig files
my folder structure
Read 5 tweets
Mar 30
[COMO CONSEGUIR O SEU PRIMEIRO EMPREGO COMO DEV BACKEND]
Masterize uma linguagem que seja usual para construir APIs, recomendo Javascript, por meio do Node conseguimos rodar ele no servidor e é bem versátil para caso você um dia também queira mexer no front ☞
Orienta os teus estudos a resolver o desafio de entrevista das empresas, isso vai fazer com que você ganhe um Ótimo portfólio, e tornará o seu estudo mais dinâmico. Comece pegando um desafio bem mais difícil do que você consegue resolver e comece a quebrar em passos menores ☞
Por exemplo:

Crie uma API RESTful que deve consumir a API do github, e salvar em banco de dados próprio os dados do usuário. Ela deve conter autenticação e testes automatizados.
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(