logo
episode-header-image
May 2023
30m 4s

Your SSD lies but that's ok | Postgres f...

Hussein Nasser
About this episode

fsync is a linux system call that flushes all pages and metadata for a given file to the disk. It is indeed an expensive operation but required for durability especially for database systems. Regular writes that make it to the disk controller are often placed in the SSD local cache to accumulate more writes before getting flushed to the NAND cells. However when the disk controller receives this flush command it is required to immediately persist all of the data to the NAND cells. Some SSDs however don't do that because they don't trust the host and no-op the fsync. In this video I explain this in details and go through details on how postgres provide so many options to fine tune fsync 0:00 Intro 1:00 A Write doesn’t write 2:00 File System Page Cache 6:00 Fsync 7:30 SSD Cache 9:20 SSD ignores the flush 9:30 15 Year old Firefox fsync bug 12:30 What happens if SSD loses power 15:00 What options does Postgres exposes? 15:30 open_sync (O_SYNC) 16:15 open_datasync (O_DSYNC) 17:10 O_DIRECT 19:00 fsync 20:50 fdatasync 21:13 fsync = off 23:30 Don’t make your API simple 26:00 Database on metal?

Up next
Jun 13
kTLS - Kernel level TLS
Fundamentals of Operating Systems Course https://oscourse.winktls is brilliant.TLS encryption/decryption often happens in userland. While TCP lives in the kernel. With ktls, userland can hand the keys to the kernel and the kernel does crypto. When calling write, the kernel encryp ... Show More
22m 55s
May 9
The beauty of the CPU
If you are bored of contemporary topics of AI and need a breather, I invite you to join me to explore a mundane, fundamental and earthy topic.The CPU.A reading of my substack article https://hnasr.substack.com/p/the-beauty-of-the-cpu 
9m 38s
Apr 2025
Sequential Scans in Postgres just got faster
This new PostgreSQL 17 feature is game changer. They know can combine IOs when performing sequential scan. Grab my database coursehttps://courses.husseinnasser.com 
27m 36s
Recommended Episodes
Jan 2024
545: 3,062 Days Later
Kent Overstreet, the creator of bcachefs, helps us understand where his new filesystem fits, what it's like to upstream a new filesystem, and how they've solved the RAID write hole.Special Guest: Kent Overstreet.Sponsored By:Tailscale: Tailscale is a Zero config VPN. It i ... Show More
57m 15s
Apr 2024
Des cartes SD bientôt de 4 To de stockage ?
C’est dans un communiqué diffusé mi-avril que Western Digital, le spécialiste des cartes SD et des disques durs, a évoqué l'arrivée prochaine de cartes SD de 4 To. Jusqu’à présent, seules des cartes de 1 To étaient disponibles dans la gamme SanDisk Extreme Pro. Mais en quadruplan ... Show More
1m 48s
Feb 2024
Episode 507: Stephen Margheim on SQLite in Ruby on Rails Applications
If you start a new Rails project today, you’re probably going to pick Postgres for your database. And if you have a ten year old Rails app, you might be using MySQL. But Rails ships with support for SQLite, a lightweight SQL database. Can that lightweight database be used to make ... Show More
31m 21s
May 2019
164: Meaningless Version Numbers
The advantages of switching from semantic versioning to a sequential calendar-based system with no semantic implications, and the different marketing mindset it brings. This episode of Under the Radar is sponsored by: Linode: High performance SSD Linux servers for all of your inf ... Show More
29m 37s
Feb 2024
Postgres Replication at speed with PeerDB's Sai Srirampur
Join Scott Hanselman as he sits down with Sai Srirampur, as they explore the intricacies of Postgres Replication and how it can be turbocharged using PeerDB. In the realm of databases, Postgres Replication is like a well-choreographed dance between servers. Sai takes us behind th ... Show More
27m 6s
Jun 2024
780: Cloud Storage: Bandwidth, Storage and BIG ZIPS
Today, Scott and Wes dive into cloud storage solutions—why you might need them, how they use them, and what you need to know about the big players, fees, and more. Show Notes 00:00 Welcome to Syntax! 01:14 Brought to you by Sentry.io. 02:05 Why you might need a cloud storage prov ... Show More
29m 3s
Sep 2020
27: Picture Perfect
Some big news for Jupiter Broadcasting and a picture perfect app-pick with Lychee. Chris politely suggests Alex reconsider his Syncthing doubts. Plus some power monitoring updates, and more from the community.Sponsored By:A Cloud Guru: Looking to make a high-paying career move in ... Show More
41m 39s
Jan 2024
Robin Linus of ZeroSync & BITVM.ORG | Pioneering Proof Systems, Adoption in Bitcoin
Corey, D, and Jesse sit down with Robin Linus of ZeroSync – the team spearheading the development of proof systems for Bitcoin for scalability, interoperability, and privacy. Robin discusses everything from the recently published BitVM white paper, challenges and tradeoffs of val ... Show More
1h 25m
Apr 2024
558: Top 5 Essential Apps
We asked, and you answered: Your top 5 Linux app essentials and post-install rituals. Plus, some news to better cope with "extreme file-system damage."Sponsored By:Tailscale: Tailscale is a programmable networking software that is private and secure by default - get it free on up ... Show More
53m 22s