Category Filtering: 'mysql'

Exploring Architecture with the NodeJS mysql package

JavaScript, MySQL, NodeJS

In software design, architectural choices have a significant influence on the maintainability of your code base. Choosing the proper toolkit, while important, is not enough to guarantee a maintainable solution. Frameworks attempt to solve this problem by imposing an architecture on your code base that (hopefully) uses best practice patterns in software design to help you build a maintainable code base. I will return to the issue of frameworks (and their strengths and weaknesses) another day. 

Meanwhile, let's explore some architectural design choices we can make with the NodeJS mysql package when building CRUD applications. You can refer to my post on Creating a NodeJS REST API with Express and MySQL as a base design blueprint for building a CRUD application using the MySQL package. The application in the post makes several design choices that are not explained in any detail. Let's explore them now.

Connect to MySQL over SSH


If you are running MySQL in a VM or on a remote host that runs sshd, you can connect to MySQL using the MySQL Workbench by creating an SSH tunnel. Assuming your remote MySQL is listening to localhost on port 3306, create an SSH tunnel like so:

ssh user@host -L 3307: -N


enter your password at the prompt. Next, connect to MySQL at localhost on port 3307, the port forward will send the traffic to the remote server.


Recent Entries

Entries Search