Posts

Showing posts from December, 2024

Google Search can't be trusted anymore

I Can No Longer Trust Google's Search Results, and It's Honestly Scaring Me Because of Google's advertising-driven model, I no longer trust its search results. We all know the first page of results isn't necessarily what’s most relevant—it’s often what someone paid Google to show us. I find myself increasingly wary of using Google, preferring Bing—not because it's the best, but because it gives me more straightforward, relevant results. I remember searching for the Astoria Hotel in Dubai a while back. I typed the hotel's name and address into Google, expecting to find its official website. But the entire first and second pages were cluttered with third-party booking sites like Booking.com, Hotels.com, and similar services. It took persistent digging to find the actual hotel website, even though I had been specific with my search query. Out of frustration, I tried Bing with the exact same search. The hotel's official website appeared as the second result—simp...

WAL - What is Write-Ahead Logging in postgres Database Internal Architecture

Image
  I'll focus on the WAL (Write-Ahead Logging) system from the PostgreSQL architecture diagram,  because its the only thing there that I’d never heard of before and turns out it's crucial for database reliability and ACID compliance and also So What is Write-Ahead Logging? Write-Ahead Logging is a mechanism where changes to the database (modifications to data pages) are recorded in a special log file (WAL file) before they are actually written to the main database files. This log is used to ensure data integrity and to recover the database in case of a crash or failure. Or to put it simply: Imagine you’re building with blocks: Before you add or remove any block, you write down your plan in a notebook: "I'm going to add a red block on top." Then you go ahead and add the block. WAL does the same thing: Before saving changes to the database, it writes down those changes in a special log file. If something crashes, the database reads the log and "replays" t...