it's just a http accessible event database with filters + extra + fulltext search capability

the extra is it lets you query by instance-internal references to events (database serial keys), it lets you just get event IDs also, instead of the whole event, and it will have a full text search that lets you get the event IDs as results

all of this is core database functionality, and something i've learned from my work at the fiat mine is that very often internal things are useful. and that cat, the snipey, whiny one who has an ok business serving nostr clients, apparently, gave me the idea of opening up the internal references as it is a far simpler sync mechanism than retardonegentropy, because actually, nodes are subjective, and their internal references make a lot more sense as a way to request data.

doesn't mean they'll give it tho, some data is private so there would be gaps but that's literally internal, and private, it's just there because it is the simplest way to enable another party to sync data. this is my zero, ok, here it is. etc. the database search can also find these by all the possible other ways but it's a one-stop to just ask it for "the event you call 203"

Reply to this note

Please Login to reply.

Discussion

If you search for event IDs, wouldn't it just pull up the whole event regardless?

if you don't add an extra index as i have that includes id, pubkey, kind and timestamp

oh, my docs are inaccurate. i wrote a variable length integer encoding for this, but anyway:

// FullIndex is an index designed to enable sorting and filtering of results found via

// other indexes, without having to decode the event.

//

// [ prefix ][ 32 bytes full event ID ][ 8 bytes truncated hash of pubkey ][ 2 bytes kind ][ 8 bytes created_at timestamp ][ 8 serial ]

with this index, you can get the id without decoding the event, you can filter out pubkeys and kinds, and sort them in ascending or descending order of timestamp.

it's the bulkiest index in the tables i designed but it's there to avoid decoding events. and anyway, i also made it so decoding events is as fast as possible, using a streaming decoder scheme i wrote by hand, which is the fastest binary codec for nostr events there is, i don't see how anyone can make it faster or more compact. ah yes, and i did add further logic so e and p tags are compactly stored as the binary, the p tags i had to make an exception because some clients put hashtags in them in follow lists. so the p tags are 1 byte, 32 bytes for the pubkey, so 33 bytes. which is literally half as big as hex encoding.

i also added some further indexes, pubkey/kind and pubkey/created_at and ... well i'm not finished defining them exactly, my goal is to enable searching the event without decoding it within 2 or 3 index iterations. this is the optimal.

i also have written tests that show how big the events and indexes are, 203mb of events (my cache from my realy.mleku.dev) with 64mb of indexes, and the actual binary store of events is 130mb. so it works out to store index and event without complex, expensive compression, to about the same as the raw json of the events. i classify that as a total win.

haha lol great example of how comments on stuff become lies. the serial is the first field, for reasons of it being faster to find them in the tables. lol. i need to fix that.

Do you mind if I dm you?

check my profile and use telegram i think

obviously it might not be ideal. i will revive my matrix element installation

nostr:npub1whgjzsdrjxv5csrz2q032hpwxnjp4rpulxl0nexh62vz2dzc683qh8wqu9 matrix would be more secure so: @mleku17:matrix.org

How about simplex?

i have to install it

ok it was already installed, i have added my simplex address to my profile metadata, click on my avatar to get at it