Running a database on SAFE

I’ve seen posts about how to create a website with puts and such, but how would I install a database be it an sql or nosql server? how would pricing for that be like if it continues to take up more space after it’s ‘put’?

1 Like

No idea about installing a database.

If it continues to grow, that means adding more data, so will need more puts which will cost additional snt.

Workout a server, Safe can’t run server side code unless you modify the application to run that part in the browser. Safe itself is a bit like a key/value store, so has some database like capabilities, but no query language for example.

Then Safe can only really host static web pages that still need to call some data related APIs in the centralized / third party internet?

Client apps can directly store and retrieve data, so the need for a backend database in the traditional sense is diminished.

So, you can have dynamic pages. It just requires a different approach.


Not really.

Safe is an addressable storage medium. And like other databases you build indexes to point to the records, update indexes when adding removing records.

Files are stored as chunks and a datamap defines where each chunk of the file is and files are totally static for that datamap. Files can be changed with a new datamap being generated, giving 2 versions of the file, the original and this modified file.

Data objects can be modified which would be what is used for normal databases.


I’d say more like a hybrid. You can make dynamic sites, but much more is going on in the browser. It’s not just static HTML. You can now run heavyweight code in today’s browsers. I’ve done this in JavaScript, and now am testing out using Rust compiled to Wasm. I’ve also used Go compiled to Wasm.


Not only static data, but mutable data too, this can be mutated with very high levels of concurrency. From there we can build almost unlimited apps. The failure would be trying to build centralised apps though (IMO), so emulate centralised service. I feel we should do much better, i.e. medical info without owner/privacy issues and such. Then working with a public open data set covering all of humanities knowledge should allow us to see apps that we have not conceived of yet.



I struggled with this question for a while.

As far as I understand it at this point, the commands in the API can be thought of as being executed ‘by the network’ in a way that is roughly equivalent to ‘by the server’, but you can’t just programme your own commands for the network to process.

I hope that’s an accurate/helpful way of looking at it, apologies if not!

Although I agree with @dirvine that we should be trying to develop new ways of building apps, at this stage I find it hard to imagine completely avoiding clustering pointers to data in a way that resembles a database. The way I’m approaching it is to try and find ways for multiple smaller databases to link together in a useful fashion. For these databases I think the Mutable Data APIs will be pretty much essential.

As David says though, the real dream is for someone to come up with something no one else has quite conceived of yet. Pretty sure that someone won’t be me though!