spolu / dump

5 stars 0 forks source link

Go serverless? #2

Open BertrandBev opened 2 years ago

BertrandBev commented 2 years ago

Cool project! Is the goal to create a lighter alternative to Roam Research? Would be worth checking into Firestore to lighten the back-end dev burden, or maybe there's a reason for a custom Rust server I'm missing? I'm down to contribute if need be!

spolu commented 2 years ago

Hi Bertrand!

The goal is mostly exploratory for now. It started as an app that I wanted to do journaling (log stuff done, learnings, notes, etc..). The idea is to first enjoy it (and I do :)) and then use that as a testbed for a few ideas mostly around how information can flow within teams. It's still very TBD.

So the RUST backend is meant to be embedded (see https://github.com/spolu/dump/pull/1 which I'll merge soon) into the app to provide the very fast search capabilities we have (using sled DB so mostly in-memory and the speed of Rust to iterate on stuff and filter). It's also a much safer place to implement syncrhonization.

From there the idea is indeed to go serverless for the cross-device syncing and I'm very much align with the idea of using Firebase here šŸ‘

Does that make sense?

Here are a few chunky things that could be interesting to work on:

There's also a gazilion small features that could be added here and there obviously.

Hope that helps! Thanks for the ping \o/

cc @nicosteeg @gabhubert

spolu commented 2 years ago

ā€¦ Other direction for exploration which is quite orthogonal but with some tension between the two is professionals efficiency. What software can make you more efficient as a worker.

BertrandBev commented 2 years ago

I'm very much into exploring ideas around note taking, I spent some time working on an 'insight worth remembering' app just for me and a friend where we could dump all the insightful content we'd come across (videos, podcasts, articles, pdfs) along with quick notes. Slight issues where the rigidity of the format (all notes had to be linked to a content), and the old tree-like classification. A flatter link graph between notes is 100% better.

Ah ok so embedding sled db with ffi. Maybe we could benchmark dart alternatives to see if they're fast enough for an MVP? https://github.com/hivedb/hive https://github.com/isar/isar A clean move could be to wrap sled db into a generic library, and use it this way (through a db-agnostic interface). But hey, should end up taking a ton of time :)

I can look into Firebase integration & some UI things if you'd like!

spolu commented 2 years ago

Well sled is already wrapped in an agnostic API so I think weā€™re in a good shape Rust wise? The bulk of the FFI work has been done in https://github.com/spolu/dump/pull/1 and I feel much more confident as mentioned above implementing sync in Rust vs Dart šŸ˜…

That being said in native apps, Dart cross-compiling to C if Iā€™m not mistaken, it should be healthily fast as wellā€¦

Feel free to play with UI ideas as you see fit of coursešŸ‘

Concerning firebase, that would have to happen in Rust ideally for the syncing but a first step is probably the login part which will be flutter/dart side.

Is firebase a good solution there? What do you think of Stytch?

spolu commented 2 years ago

If you want to mess with Rust, one thing I was planning to do is have {Foo} match not only the stream Foo but also the streams Foo/* so that streams named with a /, eg Foo/Bar behave a bit like logical folders.

Thatā€™s a nice small and well encapsulated task to get going.

BertrandBev commented 2 years ago

Oh by wrapping sled I meant exposing sled's method in dart directly instead of having business logic in Rust! Kind of like creating a 'dart-sled' lib that anyone could use in principle.

When you refer to 'sync', are you talking about syncing between two devices? Isn't that just diffing a state stored on the cloud with a local state and sending those diffs to the cloud?

I think firebase is great because they have a ton of interoperable services. Login, real-time db, cloud storage, cloud functions. Implementing a basic sync with it should be simple enough (though we'd have to think about a conflict resolution mechanism, should two offline devices mess with the same states). Never heard about Stytch though, but seems like they only handle Auth?

I can take a look at the Foo/* matching (I've never seen any Rust code before, but it looks cool! Appears to have taken some functional goodies from Haskell)

spolu commented 2 years ago

Rust is awesome

Thatā€™s why Iā€™m keen on actually having the business logic there and only have UI in Dart/Flutter

re sync yes, exactly.

spolu commented 2 years ago

Note: the motivation for a local DB: