Hi there!

*Very newbish developer question preface

I'm currently starting my first real coding project by creating a basic crm platform for my company. Thinking down the line, the crm to first be accessible via web/browser. Later on, I'd like to develop an IOS/android app for our employees and clients to use later on. The app will receive the same data (such as user posts and images from the client or client contact information from the employee) as the website version.

I plan on using mysql and nodejs for the database- however,

  • What is the best way to store the data entered by users for cross-platform use?
  • Do I have a misunderstanding on how databases work to begin with?
  • Will the posts and images even be stored in the mysql database? If not, how will they be stored?
  • Can anyone recommend a good article or tutorial on setting up databases to receive user entered data and associate that data with the user?

I greatly appreciate your help on this!

Write your answer…

3 answers

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.


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.


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.

Spot On1
Show all replies

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.


Reply to this…

Hashnode is building a friendly and inclusive dev community. Come jump on the bandwagon!

  • 💬 A beginner friendly place

  • 🧠 Stay in the loop and grow your knowledge

  • 🍕 >500K developers share programming wisdom here

  • ❤️ Support the growing dev community!

Register ( 500k+ developers strong 👊)

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!

High Five1
Show all replies

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.

Reply to this…

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

2 Beers1