Good evening! I would like to create a web application with Angular 6 but I would like to have Back-end mysql (This is the only basic form I understand a bit) only. Is it possible to have mysql as back-end and without having to use php? I heard also about mongodb, but can we make requests with conditions for this management system (WHERE, LIKE ... as in sql).
-
You should look at tutorials and documentation for this ... your question is really too vague to be answered here. – Andy King Aug 15 '18 at 16:23
3 Answers
There are two layers in your application - Angular is your front-end presentation layer and an API/Web Service is your back-end data layer which returns JSON data to the front-end. You can use any RDBMS provided your API service supports it. For example, .NET WebAPI supports MySQL through .NET Connector. You can use a variety of API platforms - PHP supports mysql through mysqli and other frameworks.

- 629
- 8
- 25
-
Thank you for your reply, I am a real beginner, can you explain me the steps to follow please. – Jordan Floop Aug 15 '18 at 15:47
No, you can not communicate directly between Angular and MySQL. You'll need to build a back-end Web service that calls MySql using php or node. Angular can communicate with this back-end Web service via http.
Here are the steps you need:
1) Learn Angular. Start with the tutorial here: https://angular.io/tutorial
2) Learn how to build a back-end Web service to talk to your mysql backend. You could use php or node.js. See this article for more information. https://www.quora.com/How-do-I-connect-MySQL-to-an-Angular-4-application
3) Learn how to use Angular's http feature to talk to the back-end Web service. (Using the above linked tutorial for help.)
NOTE: You could use firebase instead. It does NOT require that you build a back-end Web service as it provides its own. You can find out more here: https://angularfirebase.com/ or here: https://github.com/angular/angularfire2

- 57,520
- 12
- 104
- 129
-
I thought about using firebase, but at some point in my app I have to search a bit more complicated on the base, but can do queries like WHERE and LIKE with firebse. – Jordan Floop Aug 15 '18 at 17:31
-
Depending on the size of your data, if you already bring the data down to the UI you can use `.filter` to perform where type queries on the client side. – DeborahK Aug 15 '18 at 17:34
-
And a quick google just turned up this: https://stackoverflow.com/questions/22506531/how-to-perform-sql-like-operation-on-firebase – DeborahK Aug 15 '18 at 17:35
If you use Angular in front-end, you can use any backend with it to connect to MySQL database, for example:
- Jersey web service written in Java
- Php with mysqli
You can also use noSQL database with MongoDB or firebase.
The choice depends on the structure of your database (so you decide if it is better to have relational on noSQL database) and another very important thing is the hosting plan on which you want to deploy your website. If you have a shared server on which you have mySQL and you want to create a relational database, I recommend you to use the following architecture (Angular as front-end, php mysqli as back-end only to select/update from database, and mySQL to store database).

- 2,051
- 3
- 22
- 46