gchamonlive 4 hours ago

Best stack cloud providers don't want you to know about, /dev/null for db and https://github.com/kelseyhightower/nocode for the backend.

  • nomel 3 hours ago

    I've never had a single issue with any user after moving our databases to /dev/null.

    • PlunderBunny 2 hours ago

      Did you route the support requests to /dev/null as well?

      • lgas an hour ago

        This is how a lot of big tech companies scale support.

  • quietbritishjim 4 hours ago

    WTF is going on with the issues and pull requests for that repo?

    • sundarurfriend 3 hours ago

      The less substance there is to it, the easier it is to talk about.

      The Chinese comments ("issues") also seem to be the same kind of jokes as the English ones, "no code means no bugs, perfect", etc., from the few I tried getting translations of. I imagine this went viral on Chinese social media, which makes sense since it's the sort of joke that's easy to translate and doesn't depend on particular cultural assumptions or anything.

    • gchamonlive 4 hours ago

      In nocode you fix nothing and you don't change anything, that's why issues and pull requests are a mess, they literally cannot be dealt with by design.

    • fennec-posix 4 hours ago

      Had to see for myself, and yeah... that's a whole lot of chaos. I'm sure I'd get the joke if I could read Chinese though.

      • eru an hour ago

        Ask Google Translate?

    • SanjayMehta 4 hours ago

      They're using it to communicate in code to each other.

      • QuantumNomad_ 3 hours ago

        Well they should stop that and start communicating in nocode instead.

pyuser583 5 hours ago

I've used /dev/null for exactly this purpose. I have output that needs to go somewhere, and I don't want to worry about whether that somewhere can handle it.

Later on in deployment, it will go somewhere else. Somewhere that has been evaluated for being able to handle it.

In that way, /dev/null is to storage what `true` is to execution - it just works.

  • CaptainOfCoit 5 hours ago

    Bug free software is a pipe dream, but if there is anything I've never encountered any bugs with, /dev/null and true is certainly in the top 3.

    • noir_lord 4 hours ago

      Joking aside I can’t ever remember seeing a bug in either bash or zsh, never seen either crash or segfault and anytime I’ve had weirdness it’s always turned out to be me missing something.

      Both (along with a lot of the standard utilities) are a testament to what talented C programmers plus years of people beating on them in unintended ways can achieve in terms of reliability/stability.

      • 1718627440 3 hours ago

        Programs not outputting a final newline to stdout leave a prompt that doesn't start on column 0, and readline seams to not takes this into consideration, but still optimizes redraws and overwrites so you get an inconsistent display. This bugs seam to exist in a lot of shells and interactive programs. The program causing the issue isn't POSIX conform though.

        • latexr 3 hours ago

          > seams

          The correct spelling is “seems”. I first assumed it was a typo, but since you did it twice I thought you might like to know.

      • AdieuToLogic an hour ago

        > Joking aside I can’t ever remember seeing a bug in either bash or zsh, never seen either crash or segfault and anytime I’ve had weirdness it’s always turned out to be me missing something.

        Given that this statement begins with "joking aside", I have to assume it is either a meta-joke or an uninformed opinion. Taking the subsequent sentence into account thoroughly reinforces the former.

        Well played. :-)

      • PokestarFan 3 hours ago

        I've been able to trigger a segfault in zsh with certain plugins, a directory with a lot of files/folders, and globs with a bunch of * characters.

    • MartijnBraam 18 minutes ago

      Ah you've never encountered /dev/null not existing yet, so when you try to trash data it will actually create a normal file there so every other program that uses it will actually append that file.

      Luckily it's usually a tmpfs

    • SanjayMehta 4 hours ago

      False.

      Wait: that's just not true.

      Carry on.

mjb 2 hours ago

Best of all, /dev/null is also serializable (but not strict serializable) under many academic and textbook definitions.

Specifically, these definitions require that transactions appear to execute in some serial order, and place no constraints on that serial order. So the database can issue all reads at time zero, returning empty results, and all writes at the time they happen (because who the hell cares?).

The lesson? Demand real-time guarantees.

  • mjb 2 hours ago

    This doesn't work as cleanly for SQL-style transactions where there are tons of RW transactions, sadly.

cluckindan 5 hours ago

Always instantly consistent, always available, and perfectly tolerant of partitioning.

Truly, it is the only database which can be scaled to unlimited nodes and remain fully CAP.

  • inopinatus 3 hours ago

    Enterprise DBAs will nevertheless provision separate /dev/null0 and /dev/null1 devices due to corporate policy. In the event of an outage, the symlink from null will be updated manually following an approved run book. Please note that this runbook must be revalidated annually as part of the sarbox audit, without which the null device is no longer authorised for production use and must be deleted

  • eru an hour ago

    Not just instantly consistent on one machine, but globally sharded all across the universe.

  • geoffbp an hour ago

    Is there a case where dev null can fail?

  • thfuran 5 hours ago

    It's really fast too.

  • tgma 5 hours ago

    Always available? Clearly you have not experienced situations with no /dev mounted.

    • pasteldream 4 hours ago

      One easy way to create such a situation is to use bwrap without --dev.

jefftk 3 hours ago

"The system transitions from one valid state to another" is clearly false: the system only has a single state.

  • mpyne an hour ago

    One of the first state machine you'll ever learn about in undergrad permits transitions from a state back to itself, so I don't see this as a barrier.

    • eru an hour ago

      And you can implement /dev/null with multiple states, as long as you make them all behave the same way.

rezonant 5 hours ago

But is /dev/null web scale?

  • epistasis 5 hours ago

    Yes, /dev/null can even power sites like zombo.com

    • bottled_poe 5 hours ago

      What’s the I/O throughput of /dev/null ?

      • epistasis 5 hours ago

        Single client, I'm getting ~5GB/s, both on an 8-year-old intel server, and on my M1 ARM chip.

        However with a single server, it doesn't perfectly linearly scale with multiple clients. I'm getting

        1 client: 5GB/s

        2 clients: 8GB/s

        3 client: 8.7GB/s

        • dinkelberg 4 hours ago

          How did you measure this? Do you know that /dev/null is the limiting factor, or could it be the data source that is limiting?

        • fukka42 4 hours ago

          I'm easily reaching 30GB/s with a single client:

              dd if=/dev/zero of=/dev/null bs=1M status=progress
          
          A second dd process hits the same speed.
          • epistasis 4 hours ago

            My artisanal architecture design uses writes with a few characters and uses unix pipes:

                yes | pv > /dev/null
            
            I hope that in my next rewrite I can advance to larger block sizes.
          • rezonant 4 hours ago

            What's the best hardware for running a /dev/null instance for production?

            • epistasis 3 hours ago

              I usually do a kubernetes cluster on top of VMs. But sometimes when I really want to scale the standard cloud server less platforms all support /dev/null out of the box. (Except for Windows...)

              • wowczarek 2 hours ago

                > Except for Windows...

                copy c:\file nul

                It's been there since DOS or more likely CP/M :)

                • epistasis 14 minutes ago

                  Still need an adapter library though! Fortunately there are about 7 competing implementations on npm and most of them only have 5-6 transitive dependencies.

            • __turbobrew__ 3 hours ago

              A single resistor at ground voltage.

              • eru an hour ago

                That doesn't support expected features like 'stat /dev/null'.

      • CaptainOfCoit 5 hours ago

        You start dealing with Heisen-throughput at that point, it goes as high as you can measure.

yuppiemephisto an hour ago

And the axiom of empty set is an inaccessible cardinal axiom

hshdhdhehd 40 minutes ago

It is also local first, low latency, data residency compliant, SOC2 compliant, zero dependency and webscale.

theandrewbailey 2 hours ago

/dev/null is the ultimate storageless function. It's like serverless, but for PII, and deployable anywhere!

imcritic 5 hours ago

How does a disaster recovery plan with it look like?

  • tadfisher 5 hours ago

    There is never a disaster; reading from /dev/null will return the same result before and after any external event.

  • wolrah 4 hours ago

    /dev/null is globally redundant across almost every *nix-ish system in operation. Just reinstall your software on whatever is convenient and all the same data will be there.

  • mpyne an hour ago

        sudo mknod /dev/null c 1 3 && sudo chmod 666 /dev/null
    
    might do it on many systems
hmokiguess 4 hours ago

I guess it is also idempotent then

1970-01-01 3 hours ago

So if you could somehow get something stuck in /dev/null would it cause a panic or what happens?

BiraIgnacio 2 hours ago

A strong business opportunity right there.

johnfn 3 hours ago

Not only that, it provides all 3 components of CAP!

  • _joel 3 hours ago

    The Jespsen tests pass quickly too!

keithnz 3 hours ago

took a while to pipe my multi-terabyte db to /dev/null but now that I have I'm saving a ton of money on storage.

dheera an hour ago

I guess /dev/null is also an excellent source of investment advice, you are guaranteed to not lose money

layer8 3 hours ago

Not on Windows.

bitwize 3 hours ago

Yes, but does it support sharding? Sharding is the secret ingredient in the web scale sauce.

idontwantthis 3 hours ago

This reminds me of how I would write a HashCode implementation on intro CS exams in college:

‘return 5’

charcircuit 4 hours ago

/dev/null is not a database. By this logic is a hard disk a database, is a CD a database. No. They are storage mediums. You could store a database on them, but they themselves are not a database.

Considering there is no way to read back data written to /dev/null it will not be useful for storing database data.

  • jonathrg 3 hours ago

    You can store any data as long as it doesn't contain any ones

    • saltcured an hour ago

      And, you don't depend on it remembering how many zeros you wrote last.

  • chrisweekly 3 hours ago

    seems you've missed the joke

    • charcircuit 3 hours ago

      It's not a funny one if it was one. Of course something is going to be a bad database if it's not a database.

      • voidfunc 2 hours ago

        "Its not funny" says the one guy in a room where literally everyone else is laughing and riffing on the joke.

        Your humor unit might be defective.

      • jfengel 2 hours ago

        It's not a great joke, to be sure. But the essence of it is that it's a good database, by relevant but inappropriate standards.

      • brobbin 2 hours ago

        It's nerd humor. You're not supposed to find it funny, but nod along approvingly while noticing how awfully clever you are for noticing the attempt at being funny.

QuiCasseRien 5 hours ago

Fast and easy to read, funny and fuckingly true !

best post of the week ^^