Finished building a proof of concept serverless nostr relay this weekend (docs to follow). This is the nostpy relay redeployed as a local-read, global-write multi-region serverless web application backed by a RDS Postgresql instance and Dynamo DB tables to manage the websocket connections. This is the first draft, still looking to make another of changes and experiment with some other architecture. Of course the original host/container deployment is quicker but this was really fun to build and I'm looking to spend my time working towards relay optimization and high availability deployments. I just wanna relay notes to nostriches over the world, quickly. #grownostr #nostruptime image

Replies (5)

What runtime do you use for your lambdas? Are you using the serverless framework? After writing Nostream, I wouldnโ€™t recommend a relational database to store Nostr events. A key-value store is better provided it supports sorted sets and range queries. How are you ensuring the events persisted in one region are broadcasted to the clients connected in a separate region?
Using the python 3.10 runtime for the lambdas. Not using the serverless framework yet, these were all manually configured functions, mostly copy paste from and don't adhere to a specific design style. Was really just shooting from the hip here to test a few things. I'm currently using rds postgresql and relying on that to update the read replicas in the appropriate regions. From the synthetics tests, this seems to update pretty quickly on db write. But I'm definitely with you on the relational database bit. I have been meaning to try to refactor this to use a nosql db as we are really just utilizing 1 table but it was what I'm familiar with so I just ran with it lol.
โ†‘