*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…
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
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.
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!
The Dev Community
Free, friendly and inclusive platform for developers
Or connect with