이 블로그 검색

2023년 3월 30일 목요일

Understanding the Role and Interaction of APM: Apache, PHP, MySQL

ARM (Apache, PHP, MySQL)

Definition

To implement a web service, a web server, WAS, and a database are required, and a term used to refer to the combination of Apache, PHP, and MySQL, which were mainly used, is ARM (Apache, PHP, MySQL).

As of 2023, web servers and WAS are typically implemented together.

Web Server

  • A computer program that receives HTTP requests from clients such as web browsers and returns web pages such as HTML documents.

  • Handles Static web Pages

    Example of Web Servers

    Apache Server, Nginx, IIS (Windows-specific Web server), etc.

WAS (Web Application Server)

  • A computer program created to provide dynamic content that requires database queries or various logic processing.

  • Also known as "web containers" or "servlet containers."

  • Handles dynamic web pages

    Example of WAS

    Tomcat, JBoss, Jeus, Web Sphere, JSP, php, etc.

DB (Database)

  • A collection of data that is integrated and managed for the purpose of sharing and using it by multiple people.

  • Managed using DBMS (Database Management System)

    Example of DB

    MySQL, NoSQL, IDMS, MongoDB, etc.

Components of Web Services

Web Server: Apache

WAS: PHP

DB: MySQL

Apache

Definition

An HTTP server created by the Apache Foundation.

Advantages

  • Supports various functions
  • Easy to build a server
  • Free

Disadvantages

  • The server itself is somewhat heavy.
  • Vulnerable to Slow HTTP Header DoS (Slowloris) attacks.

PHP

Definition

A scripting language used to control web servers.

Features

  • Interpreter-based
  • Similar languages include ASP, JSP, etc.
  • Syntax is similar to C language.
  • Stateless

Advantages

  • Easy to integrate with databases
  • Supports file upload, email sending, etc. functions on its own
  • Code can be modularized by creating and inheriting classes.
  • Fast

Disadvantages

  • Inconsistency in the names of built-in functions and argument names
  • Inconsistency in error and exception handling

MySQL

Definition

One of the Database Management Systems (DBMS).

A set of tools that help to use databases.

Features

  • Composed of C and C++
  • Based on SQL

Advantages

  • Open source with GPL license = free
  • Easy to switch OS
  • Smaller and faster than other DBMSs
  • Large user community with access to a lot of information

Disadvantages

  • Transaction support is not perfect. For example, in some database systems, transaction processing can be interrupted due to network failures or server problems. In this case, some operations have already been completed, but the remaining operations have not been processed, which can compromise the consistency of the database (ensuring that stored data is accurate and valid). In such cases, recovery functions may be provided by the database system, or developers may need to write code to maintain consistency.

2023년 3월 18일 토요일

Popular Naming Conventions for Variables: Snake Case, Pascal Case, Camel Case

Snake Case

var snake_case;

The expression style that includes underscores (_) is called snake case, named after the appearance of a snake.

Pascal Case

var PascalCase;

When the first letter and the middle letters are capitalized, it is similar to the notation used in the Pascal language, and it is called the Pascal case.

Camel Case

var camelCase;

When the middle letters are capitalized but the first letter is lowercase, it resembles the shape of a camel, so it is called a camel case.

2023년 3월 17일 금요일

The difference between stable sort and unstable sort

Definition

When sorting a list, the resulting values may be the same, but the difference in the internal sorting process creates a distinction between stable and unstable sorting methods.

Stable sorting preserves the original position of elements in the list while sorting. Unstable sorting does not preserve the original position of elements in the list while sorting.

Example

Consider the following list: [A, C, A, B, C, D]. When sorting this list in lexicographic order, it would result in [A, A, B, C, C, D]. However, it is possible to distinguish between the first occurrence of A and the second occurrence of A by assigning a unique index to each occurrence:

Given sort:

[A(1), C(1), A(2), B, C(2), D]

Stable sort:

[A(1), A(2), B, C(1), C(2), D]

Unstable sort:

[A(2), A(1), B, C(1), C(2), D]

Examples of stable sorting methods

  • Bubble Sort
  • Insertion Sort
  • Merge Sort
  • Counting Sort
  • Bucket Sort
  • Radix Sort

Examples of unstable sorting methods

  • Selection sort
  • Heap Sort
  • Shell Sort
  • Quick Sort

Logic Gate Truth Tables & Definitions

Logic Gate Truth Tables Java Code !A // NOT A&B // AND ~(A&B) // NAND A|B // OR ~(A|B) // XOR A^B // XOR ~(A^B) // XNOR ~A // Inve...