Blog of Fregiva
Let’s get technical! Here’s the server structure of Fregiva. Below, I’ll describe every step and it’s benefits.
Every page you load from Fregiva.com will come from a CDN called Cloudflare. Basically, it spreads the files to different servers around the world. When you request a file (e.g. a FAQ), it routes you to a server near to you. This assures a fast delivery of the file. This also means, that every page and file you get from Fregiva.com is static. No dynamic content from any database is delivered. The server doesn’t have to do stuff like fetching data from a database before delivering the file. That’s good for the websites speed.
Firebase is my choice of backend service. The app just communicates with their servers – in realtime over websockets. That provides a neat performance for every interaction you make in the app. Firebase is easy to set up, safe and provides many of the functions you expect from a backend like log-in-functionality and saving the users data. For some functions, you’ll have to write your own code:
The static files are stored in S3, a storage service by Amazon with unlimited capacity, nice uptimes and low prices. There’s a NodeJS Library for uploading or deleting files. If the NodeJS catches a deploy event, it will create the HTML code for the FAQ and upload it to S3 directly. I can store it as a static file with nearly no downtime at all! Users of Fregiva can be shure to be able to get the FAQ everytime they need it – even if the NodeJS or Firebase backend is down. That’s one important point when you want to deliver something for other peoples which use it on their websites.
After the FAQ is uploaded to S3, Cloudflare automatically pics up the static file and spreads it to their servers around the world. Everyone is now able to get it fast, secure and with no downtime.
I’m pretty happy with this structure. What do you mean? Are there downsides?
Benjamin Kowalski wrote this on October 15.