Hi, folks!
< chit-chat>
My name is Daniel and I’m software developer since 2002. Today I work primarily with Rails and Angular (and everything required to build a website), but I worked many years as PHP and C developer. Although I’m what is called “full-stack developer”, I’m an eternal newbie.
< /chit-chat>
I’m trying to understand how can I use SAFE on my websites.
Let’s say that I’ve a PHP + PostgreSQL website and it’s running on a cloud server (like Digital Ocean). How can I use SAFE on it? I’m thinking on these ways:
-
use SAFE as storage: mount my app files folder (php, html, js, css)
on a private NFS SAFE folder. Do the same with my database folder. -
use SAFE as CDN: move my assets files (js, html, css) to a public
mounted NFS SAFE folder. Use the SAFE DNS to point to this public
folder and rewrite the js/css references to use this url. This
unfortunatelly will only work with SAFE DNS compatible browsers. -
use SAFE as database: change the current database from PostgreSQL to
SAFE-DHT (change the code and migrate the current data). As I
understood, SAFE DHT is a no-sql database, like Redis or MongoDB
that supports private collections with key/value pairs. -
run the entire website on SAFE: this is the best scenario. On this case,
we won’t need a cloud server anymore neither to understand any language
than JS (we’ll need client-side JS not server-side JS like nodeJS), as we
don’t have a backend anymore.
The best approach to make a 100% SAFE website is to make a SPA application without any API call. No backend required. To make the website dynamic, we can access some simple JS functions that allows us to interact with the private SAFE-DHT no-sql user data. These functions are similar to the other no-sql databases and are provided by some browser plugin. Also, we can read data (or even write) from other users if they are labeled as “public”. To publish the website/app, we use the approach #2 (use SAFE as CDN).
Are my conclusions right? Or I misunderstood something?
PS: sorry my english, I’m not a native english speaker.