Oddbean new post about | logout
 apple’s private relay (MASQUE) seems better than a vpn for web requests:

1. you encrypt the request for the second hop’s exit node (cloudflare?),

2. Apple can’t see what you are requesting. 

3. The exit node can’t see who made the original request since it is proxied by apple. 

Clever! Going to try to use this in damus ios for relay connections. 
 This spec is sick. This is exactly what I was looking for

https://davidschinazi.github.io/masque-drafts/draft-schinazi-masque-proxy.html 
 Oh wait, this is different from what i was thinking 
 Yeah MASQUE uses OHTTP, but it is compatible with all servers. OHTTP request special support on the target server to decrypt requests. In MASQUE the exit node handles the decryption of the outer layer, while still providing e2e encryption for the request via QUIC. Not exactly sure how it works but sounds amazing. 
 👀 
 is the idea here to actually use apples infra or implement this yourself ? 
 If we can I would use apples infra. In the meantime I have been talking to people to potentially figure out a way to run nodes ourselves but separately to gain privacy benefits. 
 Why not just use TOR? No need to reinvent wheel 
 tor is shit 
 > No need to reinvent wheel

You’re talking to a man that wrote a custom database in C. Damus is all about new wheels. 
 The same man preferred lmbd over postgres. 

Maybe he is not the best architect? 
 if nostr used postgres and not lmdb then it wouldn’t work. The damus relay was pegged at 100% cpu with postgres. lmdb is actually the perfect match for nostr. 
 You are are something wrong.

Ditto works just fine with postgres and is a relay blaster.

Mastodon also  uses postgres to support way more users than nostr will ever see.  
 almost every large nostr relay has switched from postgres to strfry. I guess we’re all doing something wrong. 
 Yes. 

Ditto proves you wrong.

Lmbd is way too disk and cpu heavy. 
 Ditto uses strfry 
 lmao 
 No, that is the mostr.pub relay

Ditto uses sqlite or postgres  
 Not true. It's a custom relay. https://gitlab.com/soapbox-pub/ditto/-/blob/main/src/controllers/nostr/relay.ts 
 Have you tested it under heavy load ? 
 Yes, it sucks. But I am not actually sure if it's the relay or Mastodon API causing the problem. It keeps going down and I've been making Prometheus graphs to track the issue. Screenshots in my profile. Postgres itself is very good for the usual queries. Someone is doing something naughty that's choking up my connection pool. But I appreciate verita's enthusiasm for my project. I am determined to make it the best thing ever, and I think it can be.​ 
 No it isn't.  LMDB is so lightweight and fast that I don't need async function calls.  I can just assume they return virtually instantly. 
 Not only that, notedeck +nostrdb can do 1000s of queries per second in less than a millisecond, so all of my ui can be realtime and no async. Yeah so slow 🙄 
 It makes a lot of sense if you think about it, once the data is paged in, it’s just a btree data structure in memory. Especially if your data is stored as flatbuffers like strfry and nostrdb.

In fact, i doubt you can make something faster than lmdb. It’s pretty much optimal cache wise. 
 I remember when it came out in 2011 or so, people were agahst and in awe of how fast it was.. like this was impossible.  And some smart developers went digging to try to find the "problem" because it must be doing something wrong to get that speed.  And what they discovered was that it was simply using several really smart techniques in ways people hadn't put together before, like copy-on-write, b+ trees, mmap returning direct pointers to the data instead of copying it, etc.

I also think it is probably at or very near the maximum theoretical performance.

Of course unlike you, I don't utilize that performance on my relay.  wss://chorus.mikedilger.com:444/ is currently only serving 15 connections. 
 flatbuffers is great, as are binary blobs that are directly accessible without deserialization (such as my pocket-db) or rust `speedy` (barely any deserialization really, but it does still copy).  It is funny how copying something actually makes a performance difference for us. That is how fast we are now. For most people a memory copy (with its concomitant malloc) is trivial and lost in the noise of their real performance bottlenecks. 
 i have run almost every piece of relay software on the busiest nostr relay, from sqlite to postgres to lmdb, have you? Or do you just like talking out of your ass to sound like you know what you’re talking about. 
 Why you getting so defensive? You are wrong . I proved you wrong with an actual tangible thing called ditto. 
 you haven’t proven anything, you just stated another Postgres relay exists, not that it scales. 
 Ditto ! Mastodon!  

How much more proof do you need ? lol 
 Of all the things I would argue with Will about, (xmonad sux) how Nostr relays work isn’t one of them. 😏 
 haha xmonad is a bit cluncky but I have customized it too heavily and its hard to move off it :(

I would love to switch to wayland one day but im stuck 🥲 
 *quietly pretends I’m not still using dwm*😆 
 What do you think of Hyprland? 
 https://codeberg.org/dwl/dwl thank me later 
 What is this dev magic, and what does it do 
 basically dwm but on wayland. Same suckless phylosophy, suckless hackability, tons of cuatomizations by codebase patches, same config.h files to customize. Its a bit more bloat and difficult to hack-with because it implements wayland protocol and that means it needs to handle more things windows-compositor-side and sometimes breaks things from a version to another cause protocols changes. But works, its great. 
 How would you explain dwm to a someone from the cro-magnon era? 

Asking for a friend 
 a tiling window manager; a nerdy, minimalistic and hackable way to put things on screen on a linux pc doing keyboard key-combos. Often the time required to get into these things would be better spent doing real things with friends and family, but everyone has his passions I think..😅
For graphical reference, here is dwm or something very similar: nostr:nevent1qqs9d67ryv58jhr863r3gqxvnmthykcctgdd32szdq3njwalustcyaspzamhxue69uhhyetvv9ujumn0wd68ytnzv9hxgtczyqalp33lewf5vdq847t6te0wvnags0gs0mu72kz8938tn24wlfze6qcyqqqqqqgecks8m 
 Thanks. Makes sense jaffers is into this stuff 
 the ceo 🙏 
 Postgres is an academic experiment and every time I've seen someone attempt to scale it, it ends in tears.  Salty, salty tears, and massive amounts of un-necessary hardware deployed in an attempt to stop the mysterious bleeding out of its performance under a high rate of queries.  Maybe postgres Jesus will join the org and save it somehow, but he never does.  Anyway, MySQL is better, and lmdb seems best for what nostr is doing (serving notes directly from a memory mapped cache).

 
 MySQL is better? lol no. Not true at all.

NoSQL like Scylla or Cassandra would be the better choice. 

Sure, LMBD serves a lot from memory mapped cache but for some reason, IO is still way higher than competing technologies. 

Postgres is much lighter for IO for NOstr's use case. 


 
 If you mean postgres without custom configuration, absolutely. But postgres can run entirely in memory via mmap just like LMDB does.

Nonetheless I find it too heavyweight to configure and manage whereas LMDB is just compiled in, doesn't need the multiple-client stuff, the SQL parsing, the query planner, etc... if you code that stuff into your client, which can be done when the queries are not too numerous or complex.

So yeah I like LMDB better for this use case, but my brother the postgres core dev insists postgres can do key-value, nosql, all-in-memory, etc, just as good as the other databses.  I say "there there little brother, I'm sure it's real good." 
 While apple has and can have tremendous user focus, my experience with them last year leaves me skeptical on relying on yet another apple service. They have treated damus devs like 💩. 

If Will and galaxy brain devs can figure it out without apple (barring negative UX, prohibitive costs) then it is one less prospective rugpull. 
 haha this escalated 😅

Yep, sweet 👌. Cheers 
 See also @obscura … also masque based 
 OHH amazing 
 Someone linked this before but didn’t know they were using MASQUE. AWESOME. I want to use this now… 
 I think Carl also wants to offer an SDK 
 Nice.
More Apple platform dependencies. 
 apple provides relays for iCloud subscriptions in safari, but they also provide the ability to make any of your network requests use your own MASQUE servers. Not even sure you can use theirs for our purposes.

But yes, damus ios is fully integrated into the apple platform and its dependencies. It’s an ios app. Damus notedeck and android are free from this, but will be able to use the same technique because masque is just a protocol. 
 Do you have any launch date (even if it’s not exact). Want to use in my linux machine. 
 this year sometime. notedeck will be out before android 
 Using masque protocol sounds really interesting.
Using Apple servers to proxy your traffic, not at all.

We'll see how this evolves. 
🫂 
 It's Apple only though?  
 apple runs a masque relay, but anyone can. @obscura is running one for wireguard traffic 
 Going to read up on it. I wonder how painful/expensive it is to run those relays. 

Do you know who is running  @obscura? Looks super interesting.  
 Carl Dong. bitcoin-core guix/reproducible build implementor. I would tag him but I haven't implemented tagging in notedeck yet. 
 seriously, biggest corporation in the world until very  recently, does not obey the spooks

right, got it 
 😂😂 
 They have a footer on the bottom of their page to input your npub to receive messages to keep up with their development. Next to their email sign up. Very cool! 
 Saw that and signed up. Very cool feature.