Theme NexT works best with JavaScript enabled
0%


IMPORTANT:
Some of the content here is a personal summary/abbreviation of contents on the Offical MySQL Guide. Feel free to refer to the official site if you think some of the sections written here are not clear.


MySQL Intro

The MySQL client program can be used to create and use a simple database. MySQL (sometimes referred to as the “terminal monitor” or just “monitor”) is an interactive program that enables you to connect to a MySQL server, run queries, and view the results.

The MySQL server package will install the MySQL database server which you can interact with using a MySQL client. You can use the MySQL client to send commands to any MySQL server; on a remote computer or your own.

The MySQL server is used to persist the data and provide a query interface for it (SQL). The MySQL clients purpose is to allow you to use that query interface.

On how to setup your MySQL Server, please refer to here

Connecting to a MySQL Server

  • If you have installed the MySQL server on Docker using the guide here, then you should be already connected to your local SQL server. If not, try to run (assuming you have the container running):

    1
    docker exec -it <yourSQLServerName> mysql -u root -p

    This will prompt to enter the password.

    If you entered successfully, you will see:

    1
    mysql>
  • If you want to connect to a remote SQL server, then you need to specify a host name. Contact your administrator to find out what connection parameters you should use to connect (that is, what host, user name, and password to use). Then, you would run:

    1
    2
    shell> mysql -h <hostName> -u <userName> -p
    Enter password: <yourPasswordHere>
  • To disconnect from that SQL server, simply run:

    1
    QUIT

Basic Queries in MySQL Client

Make sure that you are connected to the server, as discussed in the previous section. Doing so does not in itself select any database to work with, but that is okay. There are still several queries you can do to have a basic sense of how MySQL works:

Read more »


IMPORTANT:
Some of the content here is a personal summary/abbreviation of contents on the Offical Docker Guide. Feel free to refer to the official site if you think some of the sections written here are not clear.


Docker Intro

Docker provides the ability to package and run an application in a loosely isolated environment called a container, which separate your applications from your infrastructure. The isolation and security allow you to run many containers simultaneously on a given host.

The use of containers to deploy applications is called containerization. Containers are not new, but their use for easily deploying applications is.

Docker provides tooling and a platform to manage the lifecycle of your containers:

  • Develop your application and its supporting components using containers.
  • The container becomes the unit for distributing and testing your application.
  • When you’re ready, deploy your application into your production environment, as a container or an orchestrated service. This works the same whether your production environment is a local data center, a cloud provider, or a hybrid of the two.

Docker Basics

Docker is mainly composed of the following elements (the first three is referred as Docker Engine by the official site):

  • A server (docker daemon) which is a type of long-running program called a daemon process (the dockerdcommand).
  • A command line interface (CLI) client that is used by most users (the dockercommand).
  • A REST API which specifies interfaces that CLI programs can use to talk to the daemon and instruct it what to do.
  • A Docker registry, which stores Docker images. Docker Hub is a public registry that anyone can use, and Docker is configured to look for images on Docker Hub by default.

So we see that Docker uses a client-server architecture. The docker client talks to the docker daemon, which does the heavy lifting of building, running, and distributing your Docker containers. The Docker client and daemon can run on the same system, or you can connect a Docker client to a remote Docker daemon.

Docker Architecture

  • The Docker daemon

    • The Docker daemon (dockerd) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services.
  • The Docker client

    • The Docker client (docker) is the primary way that many Docker users interact with Docker. When you use commands such as docker run, the client sends these commands to dockerd, which carries them out. The docker command uses the Docker API. The Docker client can communicate with more than one daemon.
  • Docker registries

    • A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker is configured to look for images on Docker Hub by default. You can even run your own private registry. If you use Docker Datacenter (DDC), it includes Docker Trusted Registry (DTR).
  • Docker objects

    • When you use Docker, you are creating and using images, containers, networks, volumes, plugins, and other objects. The section below is a brief overview of some of those objects.

Docker Objects

  • IMAGE
    • An image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some additional customization. For example, you may build an image which is based on the ubuntu image, but installs the Apache web server and your application, as well as the configuration details needed to make your application run.
Read more »


IMPORTANT:
Some of the content here is a personal summary/abbreviation of contents on the Offical Apache Maven Guide. Feel free to refer to the official site if you think some of the sections written here are not clear.


Apache Maven Introduction

  • *Q: What is Apache Maven used for? *

In a nutshell Maven is an attempt to apply patterns to a project’s build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:

  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution

Maven can provide benefits for your build process by employing standard conventions and practices to accelerate your development cycle while at the same time helping you achieve a higher rate of success.

Installing Maven

Please follow Apache Maven Guide

Creating a Project (QuickStart)

First you might want to create a workspace folder where all your Maven project resides. Then, you could navigate to that folder’s directory and run:

1
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

where the -DartifactId=my-app would be the new folder with name my-app under that directory you created.

Note:

  • If you have just installed Maven, it may take a while on the first run.

After it completes the setup, you can switch to that folder my-app and look at what’s created by Maven:

1
cd my-app

Under this directory you will notice the following standard project structure.

Read more »