Javier

538 posts

Javier

Javier

@2481632ds

Human.

Katılım Ağustos 2018
1.8K Takip Edilen37 Takipçiler
Javier retweetledi
cora
cora@paging_cora·
cora tweet media
ZXX
158
2.1K
21.2K
806.3K
Javier retweetledi
Elon Musk
Elon Musk@elonmusk·
😑
Elon Musk tweet media
QME
16.7K
59.9K
484.4K
76.1M
Javier retweetledi
Eric Zhu
Eric Zhu@ericzhu·
this one was insane
Eric Zhu tweet media
English
112
693
22.6K
1.4M
Shaun Maguire
Shaun Maguire@shaunmmaguire·
Our society is sick
Shaun Maguire tweet media
English
308
303
9.7K
780K
Javier
Javier@2481632ds·
@micah_erfan you do realize CEOs are instrumental in healthcare costs being higher than needed... right ?
English
0
0
0
6
Javier retweetledi
MC Squared
MC Squared@mcsquared34·
MC Squared tweet media
ZXX
372
8.1K
67.5K
889.2K
Javier
Javier@2481632ds·
@garrytan Disagree. The US should NOT hog the tech talent
English
0
0
0
37
The Dark Nerd
The Dark Nerd@sacrelicio·
They are correct
The Dark Nerd tweet media
English
1.8K
14.6K
368.7K
8.5M
Javier
Javier@2481632ds·
@malusita76 Gracias por postearlos, asi puedo vivir en Dinamarca sin perderme los desfiles
Español
0
0
0
86
Javier
Javier@2481632ds·
@iavins Supposedly Cloudflare uses Postgres x.com/BdKozlovski/st…
Stanislav Kozlovski@kozlovski

Cloudflare serves around 20% of the web with 46 million requests a second. Surely they must have a lot of data. Where do they store it? Plain old PostgreSQL. 🐘 Around 15-20 clusters of them. Each cluster consists of 3 servers split into two regions. The primary region is where the writes go, and the secondary is the region which replicates this data asynchronously and serves reads. Within those servers exist many databases owned by different people - they essentially offer multi tenancy. And as you know, multi-tenancy comes with a lot of challenges: 🤨 How do you decide which physical cluster a new tenant goes into? As they say in CloudFlare - it’s more of an art than a science! 🎨👨‍🎨 Think twice. Deploy once. 👌 But it depends on a lot of questions that get asked, like: • Is your data the source of truth, or can it be repopulated from elsewhere? • How sensitive is the data? (PII, etc) • What’s the expected traffic pattern - read heavy or write heavy? • How long do you need to store the data for? • How are your apps opening connections? (connection hungry apps can take a lot out of postgresql) • What is the growth projected to be? 🐙 Well-Connected DB Each connection in PostgreSQL is a new OS process. This makes connections expensive! As such, Cloudflare has to gatekeep the number of connections - and it does so, via PgBouncer. 🛡 🐬 PgBouncer pools a maximum server-side connections which it then allocates across tenants. From there, it forwards queries to HAProxy, which load balances across Postgres’ primary and read replicas. 🆙 High Availability The latency of an offline database is infinite. To keep high availability, CloudFlare uses the Stolon cluster manager to replicate data across Postgres instances and elect leaders/failover under high load scenarios. Health is tracked via a local health check on each node that periodically heartbeats to a distributed store like etcd. 🦏 Thundering Herd When apps get redeployed, they re-initialize all their state and connect to the database at once. This can be costly, as they compete with other tenants for the same shared underlying physical resources. Cloudflare implemented a way to handle this in their own fork of PgBouncer - it supports granular load shedding by either throttling or outright killing existing user connections. 🌞 No Clouds CloudFlare does NOT run on the cloud. They deploy on bare metal instances in their own data centres without any virtualisation whatsoever. As such, they hit some unique challenges here too: • 🔥 natural disasters / cooling issues e.g if your data centre in Portland overheats due to hot weather, your performance slows down. You can say your “db is running hot”, but bad puns aside - your data infrastructure should be resilient to that. • ⚡️ network partitions It’s a lot of work to get to the bottom of diagnosing a network partition. You have to test connectivity between a lot of components. Instead of being reactive, CloudFlare is proactive and runs chaos tests to test their distributed system’s behaviour in the presence of such partitions. 👌

English
0
0
0
130
v
v@iavins·
I can't *quickly* think of companies doing massive Postgres deployments (like petabytes or exabytes) 🤔 But for MySQL? So many come to my mind easily: YouTube, Facebook, PlanetScale, Uber, etc.
English
62
15
413
141K
Javier
Javier@2481632ds·
@iavins Some big MySQL deployments are actually MySQL Cluster, i.e., NDB, which is a completely different database. It just happens to be compatible with MySQL and have "MySQL" in its name. youtu.be/M1OU4nlwr5Q?si…
YouTube video
YouTube
English
0
0
0
121
Javier retweetledi
Shalev
Shalev@Shalev_lif·
Best poster moment at #NeurIPS2024
Shalev tweet media
English
28
722
10.5K
376.6K
Javier retweetledi
v
v@iavins·
For the past few months, I have been learning about internals of databases. I found many excellent articles on writing compilers, but I could not find many practical resources for databases. So I wrote one. CaskDB is the project I wish I had started with. github.com/avinassh/py-ca…
English
10
93
720
0
Javier retweetledi
Bernie Sanders
Bernie Sanders@BernieSanders·
No matter what the corporate elite tell you, let me make something clear: Universal health care is not radical. A living wage is not radical. Dignity in the workplace is not radical. Higher education without debt is not radical. Affordable housing is not radical.
English
3.1K
7.3K
35.7K
1M