Storing data for cross platform use?

3Responses

Write your response…

This answer has received 1 appreciation.

Data layer is the latest one and has nothing to do with "cross-platformity". MySQL is a full featured DB which will handle this for you, you just use MySQL libraries in your language/platform to access MySQL server and retrieve your data from there.

IIS on the image above just means a Web server (Apache, Nginx, Microsoft IIS, whatever or just a simple Node.JS running HTTP service).

Application's code is only MVC

The main code of your application is Model, View and Controller. It's called a MVC architecture pattern. This is part of code you write and at the end you just "talk" to DB server, you don't write DB server and SQL language itself.

Files

You can store files in DB as well, in blob format, for example, however, usually typical hard drive is used, for example in youwebsite/files directory. Usually it is called a file storage layer and is similar with DB layer, you just "talk" to it to get or store files, for example, you can use Amazon File Storage for that and access this service from application code.

Tutorials

I am not using Node.js but PHP, so I will give you a simple starting point on how to get modern web app up and running using Laravel PHP framework and MySQL database.

Just go to mysql.com, download MySQL Community server and follow installation guide. You may Google many articles or just set up DigitalOcean.com server out of the box or follow their guide How to Install MySQL on Ubuntu 16.04

Same for PHP. Download it from php.net and that's it. You don't need even a web server like in Node.js anymore. You can launch built-in web server.

Also download and install PHP package manager from getcomposer.org

Finally, just go to Laravel.com and follow documentation. Laravel is very simple and great full framework to get started, it will help you with database and file storage as well.

The only thing which is better than just reading docwalls is this amazing course

Basically, for Node.js process will be the same. You can find over 9000 frameworks starting from Express.

To build on Mev-Rael's fine reply, I would also suggest using a database abstraction layer that maintains a stable API boundary between the application layer and the database. If you develop your application such that it is tightly coupled with your database solution, you build technical debt, associated with any future changes in database and/or scaling. Using a database abstraction layer gives you freedom and stability. Fortune.js is a good option for a database abstraction layer.

fortune.js.org

Write a reply...

This answer has received 1 appreciation.

Databases are stored on a server and it will handle transactions that are authorized to use it. The location of the database is called by the software, and in many cases, the server is then setup to deal with the amount of requests.

For instance, with Mongo, you have a cluster of shards. Shards being multiple occurrences of a database that work much like multiple IP address for a web site. They assist with the workload, and if one is burdened or goes down, the others are able to cover for it.

Then you have a CDN (Content Delivery Network). Similar to what was described above, they serve your assets to the user. Documents, images, etc. Even though you aren't directly storing assets within a database, the URLs or location of those files may be stored so when that data is pulled, an image element will then have it's source provided for it.

However, if you're working on creating a product that a small team will use internally - you won't be facing a flood of users. So a private CRM, used by a small company wouldn't have nearly as many chances of experiencing server issues like a CMS would (like a blog) if it was public and popular.

I hope that helps a bit!

Yeah, pretty much. Your company may already have one, which would be a bonus.

We have in-house servers and host our own properties, so we've setup our own CDN since we like to separate assets from logic. This is because there are millions of users and tons of traffic.

Also, if you're not freaking over SEO (where importing remote files count against your score), then CDNs like cdnjs.com are interesting. A CDN, in this respect, is interesting since people claim that since many sites use it. So, for example, if you go to a site and they use jquery, your browser downloads jquery.min.js. If you host it, every user will need to download it at least once since it may be different from the file someone downloaded from another site with the same name - however - if you use jquery.min.js from CDNJS, even though they were different sites, the user has already received the file from the same source (cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1.. ) that you're using... so there's no need to download it again.

They say that using approaches like this speed up a site and application's performance since there's less it needs to serve out. However, at this point, servers are performing at the speed of a terramegaflipflop, so I doubt the difference is remotely recognizable unless you have a $2/mo shared host with 23478237 sites on the same server.

Write a reply...

This answer has received 1 appreciation.

I would use Firebase instead of MySQL... it's cloud data storage, cheap, and easy to implement across platforms. Hope this helps!

Write a reply...

Join a friendly and inclusive Q&A network for coders

  • 🖥Pick the technologies you like & read great content through your feed.
  • 💬Ask a question when you want to learn more about anything.
  • 🚀Share what you know & build your portfolio.
Sign up nowLearn more

loading ...