[{"data":1,"prerenderedAt":504},["ShallowReactive",2],{"project-34639728":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":47,"post_text":49,"what":50,"said":105,"maker_in_thread":193,"shape":204,"grid":208,"attempts":467,"same_week":468,"maker_shows":18,"maker_hidden":497,"reader_version":498,"card":499},"34639728","DriftDB","an open source WebSocket backend for real-time apps","title","Show HN: DriftDB – an open source WebSocket backend for real-time apps","https:\u002F\u002Fdriftdb.com\u002F","driftdb.com","paulgb",1675422728,2023,367,101,102,3109,4,"legend","dev_tools","realtime backend","library",[24,25,26,27,28],"websocket","real-time sync","shared state","edge computing","cloudflare workers","mixed",0.13,{"positive":32,"neutral":33,"mixed":34,"critical":35},15,23,1,8,47,{"idea":38,"docs":40,"pricing":42,"design":44,"execution":45,"performance":46},{"positive":39,"critical":18},5,{"positive":41,"critical":34},2,{"positive":43,"critical":41},0,{"positive":34,"critical":43},{"positive":43,"critical":43},{"positive":34,"critical":34},[48,48,43,18,34,39,48,18,43,39,39,48,39,39,34,39,48,43,43,43,43,43,43,43,39,18,34,48,39,34,39,39,48,48,48,34,43,48,48,48],3,null,{"problem":51,"audience":58,"pricing":49,"motivation":64,"time_to_build":49,"stack":68,"openness":102,"stage":103,"team_size":104},{"value":52,"source":53,"evidence":54},"Simple real-time state sync between browser clients without building custom WebSocket servers","maker",[55],{"id":56,"by":11,"text":57},"34640077","Hey HN! I’ve written a bunch of WebSocket servers over the years to do simple things like state synchronization, WebRTC signaling, and notifying a client when a backend job was…",{"value":59,"source":60,"evidence":61},"Developers building real-time multi-client web apps","inferred",[62,63],{"id":56,"by":11,"text":57},{"id":56,"by":11,"text":57},{"value":65,"source":53,"evidence":66},"Author wrote many WebSocket servers for state sync and signaling and wanted a simpler way",[67],{"id":56,"by":11,"text":57},[69,78,84,89,98],{"value":70,"source":53,"evidence":71},"Rust",[72,75],{"id":73,"by":11,"text":74},"34640601","That’s essentially what I meant. The core database is separate from the Cloudflare parts, so it could in theory run on other edges (I want to get it running on fly.io!), but for…",{"id":76,"by":11,"text":77},"34641496","Ah, you’re right, I haven’t written that up yet. The tl;dr is something like: ``` cd driftdb-worker npm i npm run deploy ``` You’ll need to sign in to wrangler if you haven’t…",{"value":79,"source":53,"evidence":80},"WebAssembly",[81],{"id":82,"by":11,"text":83},"34645878","> What does \"on the edge\" mean in this context? DriftDB has a concept of “rooms”, which are essentially broadcast channels. By “on the edge”, what I mean is that the…",{"value":85,"source":53,"evidence":86},"Cloudflare Workers",[87,88],{"id":56,"by":11,"text":57},{"id":82,"by":11,"text":83},{"value":90,"source":53,"evidence":91},"React",[92,95],{"id":93,"by":11,"text":94},"34643003","> So, I played a bit and it appears that if a client is disconnected and changes of the state happens when offline, once connected these changes will be applied to the other…",{"id":96,"by":11,"text":97},"34648857","Good catch, this should be in the react docs but it's missing. Until then, it's pretty simple. You call `const presence = usePresence( {})` and pass in any data you want, and the…",{"value":99,"source":60,"evidence":100},"TypeScript",[101],{"id":96,"by":11,"text":97},"open_source","launched","team",{"praise":106,"objections":119,"requests":145,"questions":159,"alternatives":174},[107],{"value":108,"source":109,"evidence":110},"Useful for real-time multiplayer and sync use cases","commenter",[111,115],{"id":112,"by":113,"text":114},"34640453","BTBurke","This is great. I'm going to use this with something I'm working on. The edge behavior is just what I need. When you say limitations are a \"relatively small number of clients need…",{"id":116,"by":117,"text":118},"34640643","globalise83","This looks just about perfect for powering all those team online games we all played a lot during lockdown (and still do), is that right?",[120,127,138],{"value":121,"source":109,"evidence":122},"Name suggests persistence but it is not a database yet",[123],{"id":124,"by":125,"text":126},"34642097","quickthrower2","Would be fascinating if you could build Jitsi like video ontop of this. I think DB in the name is a little misleading due to there being no persistence (I assume?) but that is a…",{"value":128,"source":109,"evidence":129},"Unclear what edge means and how multiple instances share state",[130,134],{"id":131,"by":132,"text":133},"34640352","rlt","Neat. > DriftDB is a real-time data backend that runs on the edge What does it mean for these backends to be “on the edge”? Do geographically disperse clients connect to…",{"id":135,"by":136,"text":137},"34644945","matt-attack","> DriftDB is a real-time data backend that runs on the edge. What does \"on the edge\" mean in this context? Can I just run the server part on my own infrastructure? What if I have…",{"value":139,"source":109,"evidence":140},"Websocket latency makes real-time guarantees impossible",[141],{"id":142,"by":143,"text":144},"34641517","Aldipower","How can something be real-time, if there is a websocket connection in-between. How do you ensure real time? In real-time applications response times must be guaranteed. Seems…",[146,152],{"value":147,"source":109,"evidence":148},"Persistence for long-lived rooms",[149],{"id":150,"by":11,"text":151},"34640523","> but what about the time factor? Can it be on the order of hours? So far I’ve focused on use cases where clients are online for overlapping time intervals. When all the clients…",{"value":153,"source":109,"evidence":154},"Dart\u002FFlutter support",[155],{"id":156,"by":157,"text":158},"34642671","atentaten","Can this be used in the Dart\u002FFlutter world?",[160,167],{"value":161,"source":109,"evidence":162},"Why not MQTT or a standard protocol",[163],{"id":164,"by":165,"text":166},"34640647","alexisread","I've not looked at DriftDB in depth (cloudflare worker running this is neat!), but can't MQTT handle this sort of workload? Obv. there's not a cloudflare worker running say an…",{"value":168,"source":109,"evidence":169},"How race conditions are handled",[170],{"id":171,"by":172,"text":173},"34642284","mrtksn","How the race conditions are handled? If one of the clients of the shared state delivers the the input with a delay(network issue etc.), will it overwrite state of the other…",[175,182,189],{"value":176,"source":109,"evidence":177},"NATS",[178],{"id":179,"by":180,"text":181},"34650640","bruth","Nice, have you come across NATS? https:\u002F\u002Fnats.io. The server natively supports WebSockets. There are many clients including Deno, Node, WebSockets, Rust, Go, C, Python, etc. In…",{"value":183,"source":109,"evidence":184},"Colyseus",[185],{"id":186,"by":187,"text":188},"34640731","speps","Reminds me of Colyseus: https:\u002F\u002Fgithub.com\u002Fcolyseus\u002Fcolyseus",{"value":190,"source":109,"evidence":191},"MQTT",[192],{"id":164,"by":165,"text":166},{"comments":194,"answered":195,"key":196},31,20,[197,200,203],{"id":198,"text":199},"34640743","The problem with MQTT is that most of the use cases I’m interested in involve a web browser as at least one party of the connection, and the browser doesn’t support MQTT. I could…",{"id":201,"text":202},"34642032","Compaction is where you take a chunk of messages and replace them with a single message. For example, one of the DriftDB demos is a counter (https:\u002F\u002Fdemos.driftdb.com\u002Fcounter).…",{"id":93,"text":94},{"commenters":36,"max_depth":205,"maker_replies":194,"first_comment_mins":206,"lifespan_hours":207},10,56,81,[209,211,212,214,217,218,222,226,230,234,238,241,243,246,248,251,252,253,256,258,261,264,265,267,269,271,275,277,281,285,288,290,291,292,294,296,298,302,305,307,309,311,313,315,317,319,321,323,325,327,329,332,334,336,338,340,343,345,347,349,351,354,357,360,364,368,370,373,376,378,381,382,386,390,392,394,397,400,402,405,409,413,417,420,422,424,427,428,430,433,435,439,441,443,446,449,452,455,457,460,462,465],[164,43,48,210,165,43],"project\u002Fneutral\u002Fidea",[198,43,43,210,11,34],[213,43,48,210,165,43],"34640923",[215,43,48,210,216,43],"34641831","fud101",[201,43,43,210,11,34],[219,43,43,220,221,43],"34642892","commenter\u002Fneutral\u002Fnone","chrisdalke",[223,43,43,224,225,43],"34643181","other\u002Fneutral\u002Fidea","elithrar",[227,43,39,228,229,43],"34645582","project\u002Fpositive\u002Fnone","jconley",[231,43,34,232,233,43],"34653765","project\u002Fcritical\u002Fidea","Kinrany",[235,43,39,236,237,43],"34640986","project\u002Fpositive\u002Fidea","nine_k",[239,43,34,232,240,43],"34641857","manv1",[242,43,34,232,240,43],"34641874",[244,43,43,220,245,43],"34643428","Scottopherson",[247,43,43,220,237,43],"34648675",[249,34,39,236,250,43],"34640340","samhuk",[171,41,48,210,172,43],[93,41,43,210,11,34],[254,41,39,255,172,43],"34643281","maker\u002Fpositive\u002Fidea",[131,48,48,257,132,43],"project\u002Fneutral\u002Fnone",[259,48,48,257,260,43],"34640405","fernandopj",[262,48,43,220,263,43],"34640435","scaredginger",[73,48,43,257,11,34],[266,48,43,210,11,34],"34640413",[268,48,39,236,132,43],"34640452",[270,48,43,257,11,34],"34640563",[272,48,39,273,274,43],"34641440","project\u002Fpositive\u002Fdocs","trollitarantula",[76,48,43,276,11,34],"project\u002Fneutral\u002Fdocs",[278,48,48,279,280,43],"34649677","project\u002Fneutral\u002Fpricing","SpaghettiX",[282,48,43,283,284,43],"34650607","other\u002Fneutral\u002Fnone","kentonv",[286,48,48,210,287,43],"34645549","HighlandSpring",[289,48,43,210,11,34],"34645635",[112,18,39,228,113,43],[150,18,43,257,11,34],[293,18,39,228,113,43],"34640541",[295,18,48,210,113,43],"34640653",[297,18,43,210,11,34],"34643453",[299,39,34,300,301,43],"34642507","project\u002Fcritical\u002Fdocs","jcq3",[303,39,43,304,11,34],"34642886","maker\u002Fneutral\u002Fdocs",[306,39,39,273,301,43],"34643268",[186,308,48,210,187,43],6,[179,310,48,210,180,43],7,[312,310,43,220,280,43],"34653164",[314,310,43,220,280,43],"34653175",[316,310,43,220,180,43],"34653676",[318,310,43,220,280,43],"34658037",[320,310,43,220,180,43],"34658488",[322,310,43,220,280,43],"34659074",[324,310,43,220,180,43],"34659270",[326,310,43,220,280,43],"34659605",[328,310,43,220,180,43],"34659874",[330,310,43,220,331,43],"34658652","autobeam",[333,310,43,220,280,43],"34659032",[335,310,43,220,11,34],"34661484",[337,310,43,210,11,34],"34653826",[339,310,43,220,180,43],"34656863",[341,310,43,342,11,34],"34661298","commenter\u002Fneutral\u002Fidea",[344,310,43,342,180,43],"34676211",[346,310,43,342,11,34],"34676991",[348,310,43,220,180,43],"34678212",[350,310,43,220,11,34],"34679294",[352,310,43,353,180,43],"34682859","commenter\u002Fneutral\u002Fexecution",[355,310,43,356,11,34],"34683426","maker\u002Fneutral\u002Fexecution",[358,35,39,228,359,43],"34643999","jwilber",[361,362,48,210,363,43],"34647446",9,"winrid",[365,205,39,366,367,43],"34640544","project\u002Fpositive\u002Fdesign","JohnCClarke",[116,369,48,210,117,43],11,[371,369,43,372,11,34],"34640769","maker\u002Fneutral\u002Fidea",[374,369,34,232,375,43],"34640805","Thaxll",[377,369,43,210,11,34],"34641279",[135,379,48,380,136,43],12,"project\u002Fneutral\u002Fexecution",[82,379,43,380,11,34],[383,384,39,236,385,43],"34646143",13,"bufferoverflow",[387,388,48,210,389,43],"34653937",14,"nextaccountic",[391,388,43,210,11,34],"34654080",[142,32,34,393,143,43],"project\u002Fcritical\u002Fperformance",[395,32,43,396,11,34],"34641844","project\u002Fneutral\u002Fperformance",[124,398,48,399,125,43],16,"project\u002Fmixed\u002Fidea",[401,398,43,210,11,34],"34642165",[403,398,39,404,125,43],"34642222","maker\u002Fpositive\u002Fnone",[406,407,48,276,408,43],"34642479",17,"ocimbote",[410,411,39,404,412,43],"34640808",18,"stmblast",[414,415,48,210,416,43],"34651962",19,"arthurcolle",[418,195,48,210,419,43],"34641146","jaime-ez",[156,421,48,380,157,43],21,[423,421,43,380,11,34],"34642784",[425,421,48,276,426,43],"34646459","rgbrgb",[96,421,43,304,11,34],[56,429,43,236,11,34],22,[431,429,48,396,432,43],"34640331","dabeeeenster",[434,429,43,396,11,34],"34640375",[436,429,34,437,438,43],"34641283","project\u002Fcritical\u002Fpricing","tmikaeld",[440,429,43,279,11,34],"34641447",[442,429,43,283,438,43],"34662840",[444,429,43,283,445,43],"34642680","e1g",[447,429,48,279,448,43],"34645070","unraveller",[450,429,43,283,451,43],"34654566","crabmusket",[453,429,34,437,454,43],"34640815","ArtWomb",[456,429,43,210,11,34],"34640987",[458,429,39,459,454,43],"34641526","project\u002Fpositive\u002Fperformance",[461,429,43,283,11,34],"34643214",[463,429,48,210,464,43],"34641106","avinassh",[466,429,43,210,11,34],"34641238",[],[469,474,479,484,489,493],{"id":470,"name":471,"points":472,"category":473},"34635352","Maroofy",753,"ai",{"id":475,"name":476,"points":477,"category":478},"34713202","Filmbox",658,"creative",{"id":480,"name":481,"points":482,"category":483},"34706098","Kuboble.com",437,"games",{"id":485,"name":486,"points":487,"category":488},"34646199","Glidesort",389,"languages",{"id":490,"name":491,"points":492,"category":20},"34648266","DocsGPT",256,{"id":494,"name":495,"points":496,"category":483},"34685086","FlappyBirdle",232,false,"v2",{"id":500,"name":5,"line":6,"ai":497,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":501,"maker":11,"domain":10,"tier":19,"attempts":43,"strip":502,"url":9,"mix":503,"praise":108,"objection":121,"sub":21},34639728,[24,25,26,27,28],"3304153405535515300000005413515533310333",[32,33,34,35],1794036630781]