Oddbean new post about | logout
 CALLING ALL #NOSTR DEVS
Someone please review this before I start to go further...
https://forge.happytavern.co/oceanslim/grain/
#asknostr #golang #dev #relay 
 I'm not in golang, sorry  
 @mleku this is right up your alley. 
 I'll throw this on my to-do list to look over when I have time!

What direction are you thinking of going next on this project? 
 Well rn top priority is probably rate limits 😅 It's still very early, but I want a highly configurable relay that the code base is easy to maintain. So configure rate limits by kind and highly configurable black/white lists for events are probably my next steps, among explicitly handling kind 3 and 5 are probably next on the to-do.  
 Okay... since I made this post, the relay has gotten FAR better. I hear y'all are taking a look so please look at the most recent changes. Now, there are HIGHLY configurable rate limits along with a nice working frontend to display a ui. I think I'm almost ready for an internal test.  
 You're working fast!

I recently bought a house and am in the middle of a bunch of rennovations, so free time is scarce at present.  But I do want to look this over soon.

What would be the best way to reach out to discuss the code and give suggestions? 
 nostr dm is fine. For a audio chat we can use cornychat but I also use discord if you prefer.  
 ELI5 why this instead of using Relayer (Nostr relay server framework) 
 Idk, can you show me the relayer codebase? I want a more configurable relay, I like Go Programming, I wanted to use mongoDB and for these reasons I built my own.  
 oh cool,i was hoping someone might try mongo , are you good at mongo schemas or whatever they are called?  
 As with most of my coding ventures, this was a learning experience. So it was my first time handing mongoDB stuff but it's a non SQL database so it's just a bunch of json docs really. It's been very easy to work with. 
https://media.tenor.com/KXycgyu1VEQAAAAM/first-firsttimer.gif 
 cool, haha, yeah its been a while since i did stuff with mongo, mostly just on the sysadmin side.. 
 Mongo works well with a vectorDB. 
 🤔
https://www.mongodb.com/products/platform/atlas-vector-search 
 This was also the idea behind using Mongo. I looked very feature rich and more easily scalable if deployed to a cloud.  
 I'm curious why almost no one uses ORM these days? At least in C# and seemingly in PHP it's not only easier, but can even be as performant, or more performant if used correctly. But the major part is, it allows databases to be pluggable... Thats like my whole thing with my C# framework. Bring just about any database you want, or build your own connector. 

For my own uses, using compiled and cached stored procedures was just slightly slower than using ORM. I suppose I could have been using the databases incorrectly but that seems to be the consensus, and no need to handle migrations or db setup scripts! 
 i use orms all the time. rn its prisma 
 I have very little experience with ORMs but I've heard some good things about drizzle 🌧️ 
 I appreciate anyone's product more when they consider a pluggable architecture to give the sysadmin more options! I tend to immediately drop a project for a service/dependency lock-in. Give me options! Most projects don't change as they age, often dig deeper into their hard-coded architecture imo 
 I used to build Doctrine. Liked the data quality control. 
 We had customers with different databases and schemas, so we'd just map to the ORM. 
 Careful just reusing the same frameworks and libraries, everywhere. There should be some completely independent implementations, for resiliency. 
 nostr:nprofile1qqsqxefne258ydmfgm2wfl02fsdqgs0d5wx29kweg9amxcqxew4t7kqpzamhxue69uhhyetvv9ujumn0wd68ytnzv9hxgtcpr4mhxue69uhkummnw3ezucnfw33k76twv4ezuum0vd5kzmp0qythwumn8ghj7un9d3shjtnswf5k6ctv9ehx2ap08hl937 nostr:nprofile1qqs8eseg5zxak2hal8umuaa7laxgxjyll9uhyxp86c522shn9gj8crsppemhxue69uhkummn9ekx7mp0qy2hwumn8ghj7un9d3shjtnyv9kh2uewd9hj7qg6waehxw309a5xjan9w3skc6ewdehhxarjxyhxxmmd9uzkz6d0 nostr:nprofile1qqsdcnxssmxheed3sv4d7n7azggj3xyq6tr799dukrngfsq6emnhcpspz4mhxue69uhhyetvv9ujuerpd46hxtnfduhszythwden5te0dehhxarj9emkjmn99uq3vamnwvaz7tmzv4mx7tnwdaehgu339e3k7mf07mjd7k
Some of the rate limiting isn't quite right yet and it's missing a req limit but the limit event by kind and category is working. Still a lot of work to do.  
 I'm new to the database space, let alone creating one for nostr. where could I get started? 

I do think we'd need some special permissions for kind 30041 (modular content - publishing multiple sections of an article) because of publishing notes at high frequency and 1986 (embeddings), of which the vectors could get quite large. 

Maybe we can iterate on best practices and specs for both perspectives relay and events?

https://wikifreedia.xyz/nkbip-01/npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl

https://wikifreedia.xyz/nkbip-02/npub1m3xdppkd0njmrqe2ma8a6ys39zvgp5k8u22mev8xsnqp4nh80srqhqa5sf 
 I was just reading these today! I'll have to make sure I'm handling NIP01 fully correctly before I can begin adding advanced improvements like this! I've already handled database interactions because the only data it accepts right now is events and I'm successfully rate limiting that. I just want to add more rate limits for requests and all types of messages. But the rate limiting is more for the websocket messages now and not the database. 
 alright, I think rate limiting is working :) . Time to make some tests for it! I've never made tests for anything. Wish me luck.  
 🔥🤞✊