Node js with php mysql

Php how to manage mysql nodejs

After this new project is in production, I will start to rewrite for nodejs the functionalities server side & client side; one at a time (keeping my local dev environment & all my project in prod always in sync). Should I better be : For my first node apps : using a proxy like Nginx to have node & apache, mysql & mongodb side by side ? or is it worth investing the time now to have my php engine working with node, using modules for php, sql ?

How to handle users managements with node js and mysql

Is working with Node js and mysql is reasonable in android app development ? because all the tutorials I found is with mongodb and I can’t use it because apparently my country is restrict from access it

what I want in my app is user management and upload images

am coming from php so the user management can easily done with session but how it done here

so will mysql do this for me our should I use something else !?

Ok, MongoDB is a no SQL database you will have some flexibilities there but SQL is more structured and it can be used with nodejs.

Читайте также:  Php sql только ассоциативный

The use case is something you should think about. To give you an example suppose the data you are storing is not same for every user then NoSQL(Mongo DB) is preferred but there are ways around to do such things in SQL(MySQL) by normalizing the data.

So, You can use MySQL. In my opinion.

Here is one example you can try.

How to connect node.js localhost at port 80 with apache mysql at, The npm module mysql should do the trick. Basic connect would look like this: var mysql = require(‘mysql’); var connection = mysql.

Using Node.js with MySQL

In this video, you are going to learn how to use MySQL using Node.js and Express. We are Duration: 48:19

How To Connect Node.js With SQL Server

This Node.js MySQL tutorial will help you understand what is MySql and how to connect Node Duration: 26:35

Getting Started with PHP, NodeJS and MySQL

In this video I show you how to create basic PHP and NodeJS apps that query an online MySQL Duration: 13:41

Nodejs hosting with PHP/Mysql

I have gone through NodeJS and PHP hosting

I also have a website in PHP/Mysql and node js. Common functionalities like login, register, manage users can be managed in PHP (Saves my time) and realtime updates in Nodejs (Learning curve). I have never bought a hosting server before. Which is better option for a newbie

  1. Hosting in PHP/Mysql and in Node Js (Only real time updates will be managed using node js)
  2. Hosting only in Node Js (Devlope entire website in Node)

Which is feasible in terms of Cost, Support and maintenance.

Is there any check list that can help me while buying a hosting server PHP+Mysql+NodeJS OR only NodeJS

You said you read NodeJS and PHP hosting. but the answer is in the subject.

The options are DigitalOcean, AWS (Amazon Webservices) and Heroku.

The easiest is DigitalOcean according to Dencker. I personnaly tried Heroku and it was all I needed.

Connecting MySQL with NodeJS, Run the following command to check nodejs is installed in the system before running the command of installing mysql client of nodejs. It will show the installed

Creating nodejs apps in php/mysql framework with later on full step by step migration to nodejs in mind

I’m looking for the most efficient path to convert over time my own made php framework for nodejs and I believe that nodejs experts and specific developers who had their years working with apache/php/mysql will be able to give objective answers based on knowledge and experience that won’t be just opinions but solution to a problem.

I’m working on a project that requires real time functionalities for which node/socket.io appear to be the most efficient solution.

CONSTRAINTS

  • I’ve built my own php/mysql OOP framework to manage projects over the years with some very nice functionalities for web content managers and nice functionalities for me to radically simplify specific development (based on my own personal logic obv.) and manage all my projects in just one instance of my framework.
  • There is no way I can rewrite all this for node just now.
  • I have to keep taking advantages of my framework & back-office tools to work fast while developing my first node apps.
  • After this new project is in production, I will start to rewrite for nodejs the functionalities server side & client side; one at a time (keeping my local dev environment & all my project in prod always in sync).

How do I start introducing nodejs to my framework ? so that

  • I won’t spend too much time on it now (except for the node apps I need obviously)
  • I won’t have too many headaches when I start replacing php and the old js to take advantage of node
  • php/mysql & js/mongodb should nicely cohabit on the servers until there is no more php in the framework

my framework logic - abstracted without all the details

my framework logic — abstracted without all the details :

What follows is where I’m at, possible solution I’ve identified & am considering, not additional questions + there may be other ways I’m not aware of yet, hence the post.

  • For my first node apps : using a proxy like Nginx to have node & apache, mysql & mongodb side by side ? or is it worth investing the time now to have my php engine working with node, using modules for php, sql ? another path ?
  • writing the node apps with mongodb as db server & when necessary exchange values from sql to the app using php ? or is it worth investing right now the time to move from mysql to mongodb the full framework rather than after one tool/functionality at a time ? another path ?
  • converting
    • From top to bottom (i.e. starting by replacing the http request handler & have js passing the ball to php for the rest and so on, would I be able to do that ?)
    • From bottom to top (i.e. the plugins, the backoffice tools, then templates, then rendering engine. ) ?

    You may want to consider adding a proxy layer while you are migrating. This provides one URL for your application while specific parts are on separate servers. This is the general approach used by people who use microservices. There are several instances of the services behind one URL space. Something like Zuul or nginx work well there. This lets you hide the fact you are running different servers with very different implementation details from your users.

    Next I would start by implementing your first new node apps. Sometimes several smaller apps work better than one large one. It really depends on a few factors. The new architecture can live next to the old architecture just fine.

    Do just enough to get moving in the right direction, then evaluate what you have. The more your legacy app migrates to only rendering JSON, the less dependent you are on the style being right.

    While most folks who ask architecture questions here do so prematurely (they really should be writing some code first to gain a fundamental understanding), I’m going to suggest to you that you should make some basic architectural decisions first. These decisions are technology-agnostic; if you follow them, it’s going to matter less what the actual technologies you choose are.

    Architecture is fundamentally a way to organize your application. It provides a skeleton by which you can organize your thoughts, break up large pieces into smaller ones and provide better maintainability by writing your application as a loosely-coupled collection of modules. When you do this, you’ll find that you can focus on writing each module independently, without worrying about what the others are doing or what technologies they will be using.

    There are many architectures to choose from, but they all essentially work the same way: they give each module a role, and then establish interfaces between your modules. So to create your architecture, all you need to do is figure out what each module is going to do, and then give them ways to communicate with each other.

    Every application architecture that provides shared resources (such as a database) to its users involves a client and a server in some way. Since you need to generate web pages to create a web applicaiton, this can take two forms: client-side rendering and server-side rendering. Because your current application is using PHP, I assume that you’re using mostly server-side rendering. That architecture looks something like this:

    Database PHP Web Server Web Browser 

    In a client-side rendering scenario, your architecture would look more like this:

    Database Service Layer Browser App Web Browser 

    Your Service Layer could be broken down like this:

    Where DAL is your Data Access Layer (i.e. a Data Mapper) that provides CRUD (Create, Read, Update and Delete) functionality, and BLL is your Business Logic Layer containing methods that encompass your business operations.

    So where does Node fit in? In a client-side rendering scenario, Node would live in your Business Logic Layer. In a server-side rendering scenario such as the one you have, things get a bit more complicated; you’ll have to figure out how to get node to produce your web pages for you.

    Anyway, the point of all this is to give your application boxes to live in. Each box can be designed, written and tested individually, separate from the other boxes. Your technology decisions can also be made for each box individually. When you’re done, you can connect all of the boxes together, do some integration testing, and have a fully functional, loosely-coupled, maintainable application.

    Further Reading
    Gateway
    Service Layer
    Data Mapper
    Domain Logic and SQL
    Server-Side Rendering with Node

    Node.js MySQL Create Database, To create a database in MySQL, use the «CREATE DATABASE» statement: Save the code above in a file called «demo_create_db.js» and run the file:.

    Mysql push notice to node.js

    i want to build a application which will use the tech of node.js, socket.IO and mysql and php the application will include a admin system which using php and mysql the application will also include a frontend pages which using html and node.js

    im wondering is it possible the mysql auto send a notice to node.js server, then the server pull the msg to frontend?

    i knew that, it is possible to send the msg from the admin system, but i just want the frontend side listen to the mysql server, any query update it will give a notice to frontend, instead of using admin system to push the msg to node.js and then to push to frontend

    i knew mssql has the feature, but donno mysql hv too?

    On the first view it might look like a cool idea — you update the database, MySQL notifies a generator which then updates your apparently static, pre-generated HTML frontend files.

    Think about which part of your stack actually knows best about which data you pull into your different pages and when you have to trigger an update. The database doesn’t and shouldn’t.

    Don’t overcomplicate things just because you change the way your stack works 🙂 your admin software is the right part of your stack to trigger re-caching or updating of output files. Then you have a clear responsibility chain:

    • Admin: data and page management
    • Database: data persistence layer
    • Frontpage generation (usually done on demand in most cases, using php — but of course you can do this when and how ever you want :))
    • output persistence ( caching or just simply writing a static file to disk )

    How To Connect Node.js With SQL Server, This Node.js MySQL tutorial will help you understand what is MySql and how to connect Node Duration: 26:35

    Источник

Оцените статью