Remix.run Logo
Show HN: Write SaaS apps where users control where their data is stored(github.com)
41 points by WolfOliver 6 days ago | 21 comments

Hello HN,

I would like to share with you linkedrecords.com - an open source backend as a service I'm working on since some time now. You can think of it as an firebase/convex alternative with an interesting twist.

In 2018 I needed to write large software requirements/architecture documents in Google Docs. While I was annoyed by the limitations of Google Docs back then (no captions on figures, no automatic heading numbering, slow when docs are bigger,...) I was still fascinated by the real time collaboration features of it. So I've started a quest to understand how it works and I begun to implement an alternative to Google Docs.

I was convinced that this kind of real time collaboration is the future so I've given it much thought how I could make this as generic as possible so I could use it in all future tools I would build.

In the same time I was playing around with firebase (surprisingly you can not build a google docs alternative with firebase that easy as their real time collaboration does not provide merging text but rather just JSON). And back then I was also convinced that backend as a service is the right way to go. I was thinking that one of the most important reason we were still writing custom backend code is because of authorization.

I also was faced with another problem when trying to make the backend as generic as possible: relations between entities are also domain specific. E.g. A Documents can have many comments.

Luckily I was intrigued by another concept back in 2018 it was called web 3.0. Back in 2018 this had nothing to do with crypto. It was used as a term to refer to the semantic web and the resource description framework as one of its standards. There are also some RDF implementations which I could have reused but they are all XML and mostly Java based. I needed something light. Instead of implementing my own RDF product I took the idea of the RDF triplestore and came up with my own interpretation of it.

Using concepts like: triplestores and schema-on-read, I came up with a system that does not has any business logic in its backend and while working on my Google Docs alternative I felt in love with it as I've discovered some properties I did not anticipated from the get go:

- Dealing with global state in react is very easy. It feels like you use an SQL client in your browser and all queries are reactive and always up to date. When writing a query you do not have to think about authorization it's all backed in. - Because the backend is 100% free of domain specific code you can point your single page app to any linkedrecords deployment. - You never have to write backend code - Its quite efficient when using AI agents

The best way to experience it, is to follow this little tutorial: https://linkedrecords.com/getting-started/

It takes a while to get a hang of it so you have to have an open mind.

I would love to read your feedback on this.

Avery29 an hour ago | parent | next [-]

This is especially interesting for API products. The tricky part is not just where user data lives, but where logs, traces, backups, and billing metadata live too.

_matthew_ 4 hours ago | parent | prev | next [-]

I had a similar idea but with a much lower-brained approach of security through purely uuid uniqueness (to some degree, similar to the initial writer controlling access), and without any actual constructs built into it:

https://github.com/matthewscholefield/blobse

Which powers a few small apps like https://matthewscholefield.github.io/votosphere/

Have you considered adding an llms.txt for linkedrecords? I'd love to be able to just tell my agent to build something and point it at your llms.txt and have it just build it out on its own reliably without having to clone the repo, go through the docs, etc.

WolfOliver 2 hours ago | parent [-]

This reminds me of the sister project of linkedrecords. It is called DJAPI. And API for Data and Jobs.

It was a public API without authentication. Everybody could upload a blob and received an access and encryption key which the client can use to access this particular object. The the client could also trigger a job using the data and producting an outcome. The outcome could then be downloaded and decrypted by the client with the keys.

While linkedrecords is the BaaS part of serverless DJAPI was the FaaS part of it. I've used DJAPI to upload LaTeX files and create a PDF out of it. The actual plan is to merge those projects at some point.

nullbio 2 hours ago | parent | prev | next [-]

This sounds cool, but how do you protect your product from pirating?

If your entire product is turned into a frontend app, and all of the infrastructure is stored on the users backend, doesn't this effectively mean they can just use your service for free?

And if you try and gate it in the frontend, obviously that can just be stripped out with an LLM in 3 seconds.

Am I missing something?

Also curious about how payments would work in a system like this.

WolfOliver 2 hours ago | parent [-]

That is a very good observation. see a comment below:

> One interesting open question now is: It is easy to say how the backend provider would bill the company for its services. It is harder for the app provider (the SPA) to bill their services.

WolfOliver 2 hours ago | parent [-]

Maybe this aligns with the current direction we are moving with AI. The frontend app itself becomes more and more worthless and in the future every frontend is custom made. linkedrecords makes this very possible especially if you combine it with some form of upper ontologies where apps can collaborate on the same data.

Maybe it is not as big of a problem as pirating the app would be against the companies SLA and serious businesses who pay the most money would just not do it.

But yes, it is a open point.

nullbio 2 hours ago | parent | next [-]

It's a very interesting idea. You've given me food for thought. Maybe the payment model becomes purchasing access to the frontend, instead. But then you're back to square one with traditional infrastructure to accomplish the gating. It could be lighter weight though.

I'm curious about the encryption side as well. Still reading through your docs.

I'm also a little skeptical on the claim of it making things simpler. It kind of feels like it just moves the responsibility. Instead of developing infrastructure/backend and communication with it, you instead have to accomplish most of that on the frontend instead? Maybe it does simplify things in the end but my intuition is telling me that you'll end up with an equal amount of different types of complexity.

WolfOliver 2 hours ago | parent [-]

There is not encryption for data at rest. It might be something I look into.

WolfOliver an hour ago | parent | prev [-]

... You could also sell a desktop app instead of a SaaS app. And then the desktop app connects to linkedrecords server. This model a few advantages: - You can do the purchasing in the app (.e.g traditional license keys) - The user is not affected if your business closes. He still has the desktop app running locally and can use any linkedrecords server.

danpalmer 3 hours ago | parent | prev | next [-]

Anything that explores triple stores in production more is interesting to me, nice one!

That said, the load test immediately stuck out to me as being too small scale. Triple stores can have performance issues, and the amount of operations in the load test isn't enough to exhaust a single node, let alone a multi-node setup. If you're looking to make a more convincing case I'd benchmark where one node falls over and get some sense of the ability to horizontally scale.

WolfOliver 2 hours ago | parent [-]

That is true. The load test is now at a scale which supports the app I'm running with it.

I also know that the bottleneck is the triblestore which is currently a simple postgresql table with three columns (to put it simply). Now the system has to check in with the triplestore for each operation to find out if the operation is authorized. I'm thinking that it might be possible to replace this kind of auth check with a Zanzibar based system.

https://en.wikipedia.org/wiki/Google_Zanzibar

jasonkester 3 hours ago | parent | prev | next [-]

Sounds cool, but you never got around to explaining how “users control where their data is stored “, which is odd because that’s the title of your post.

So if I’m a user of an app built with your thing, how do I go about controlling where my data is stored? What’s the experience like for the end user to set this up and connect it to an app?

WolfOliver 2 hours ago | parent [-]

Thank you for pointing it out. Maybe the website does a better job in this then the GitHub repo: https://linkedrecords.com/

But even on the website I guess it could be explained a little bit better.

the first question is where is the "user". It could be the end user like you and me who want's to use some app (e.g. calorie tracker). Or it could be a company subscribing to a SaaS. In this case the user would not be the end user but the company.

The later is the more interesting use case in my opinion. Now the user/company can subscribe to a linkedrecord based SaaS and let it point to a linkedrecord backend this company trusts. the company itself does not need to operate neither the SaaS app (which is a simple SPA) nor the backend.

One interesting open question now is: It is easy to say how the backend provider would bill the company for its services. It is harder for the app provider (the SPA) to bill their services?

jasonkester 2 hours ago | parent | next [-]

Yeah, you definitely should have linked to that instead of a Github repo (or copied the text across to the repo readme).

The copy is still pretty focused on the Developer experience building something that uses your thing. But I can't imagine anybody choosing to use this for a product until they know for sure that the end-user experience is painless and frictionless.

I'm actually in the market for something like this. I'm building a game that could benefit from letting people store their savegames in the cloud, but I don't see any particular reason for it to be _my_ cloud. I'd rather not store user/pass information or data at my end, and I'm sure players aren't interested in making an account on my site just to play the game.

If there was something like this that was sufficiently frictionless (on the order of magnitude of going through a "Log in with Google" flow) to set up, I'd be keen to give it a shot. But if there was anything user facing that felt "Open Source", that would kill the idea dead.

Do you have an example of a user setup flow?

WolfOliver 2 hours ago | parent [-]

the login flow is quite straight forward and much of the expirience depends on the OpenID connect provider the backend is trusting.

You can go to https://monsterwriter.com/ and see the system in action. When you click on login you will be redirected to a login provider, which in case of MonsterWriter is auth0. But it could also be an open source (e.g. KeyCloak) or any other commercial OIDC provider. Then it is up to the OIDC provider to display the "login with Google"

The hello world example on the website provides a dummy OIDC provider, If you try out the hello world example I guess this is the best place to really get an idea: https://linkedrecords.com/getting-started/

jasonkester 34 minutes ago | parent [-]

I tried your monsterwriter site (nice looking app, by the way), and logged in with google. I don't see any option to "control where my data is stored". As far as I can tell as an end user, I've just created an account on your site.

Reading the Getting Started code, it only shows me configuring storage as a developer. Nothing about users doing any sort of bring-your-own storage, let alone firing one up from scratch with a friendly workflow.

What am I missing?

WolfOliver 2 hours ago | parent | prev [-]

But also the first scenario is possible where the user is and end user. The App provider could allow to let the user pick the backend. So when the user opens the app in the browser, he will be asked to select a preconfigured backend or specify a custom linkedrecords backend URL. Once the user made this choice the app will trigger a login flow at the choosen linkedrecords backend and the app will send all request to this backend.

gurjeet 4 hours ago | parent | prev | next [-]

I think it would help demo an app or two that use this BaaS. Even better, if all those apps use/display the same data in different ways.

WolfOliver 2 hours ago | parent [-]

It's true, I'm planning a serious of youtube videos showing how to code different apps with it.

sean_pedersen 4 hours ago | parent | prev [-]

Please explain in simple words what it is and does. Is user data stored unencrypted on your servers?

WolfOliver 2 hours ago | parent [-]

The readme in the GitHub repo contains a link to the website which I hope does a better job in explaining this: https://linkedrecords.com/