+++++++php components, SQL components

Source: Internet
Author: User
Tags mssql percona

First, the basic application of PHP

Hypertext Preprocessor embedded THML Document script programming language, dynamic website development language

SOURCE Access:

Www.php.net

Dynamic website Development

PHP, ASP, Ruby, C, bash< interpreter with program function >

"PHP completes operation file via library call"

"Bash through internal programs"

Configuration file
  • php Package: Provides modules for httpd PHP scripting language for creating Dynamic Web sites

      # rpm -ql php  /etc/httpd/conf.d/php.conf           //the configuration provided for the module   /usr/lib/httpd/modules/libphp5.so   // The module provided for Prefork   /var/lib/php/session  /var/www/icons/php.gif 
  • Php-common provides a running environment for PHP

    # RPM-QL Php-common/etc/php.ini/etc/php.d/*.ini
Configuration format
[foo]directive = value
[mysql| MYSQLI] Connection MySQL driver configuration persistent: Based on a TCP connection to initiate the MySQL protocol request, constantly open, need to maintain a connection non-persistent: every establishment need to remove the connection
PHP.ini Core configuration options: "http://php.net/manual/zh/ini.core.php" php.ini configuration Options list: "Http://php.net/manual/zh/ini.list.php"
Configure read

CGI, CLI//Every time the httpd is invoked, when the child process is started, the read configuration

Fastcgi/module//Read once on startup Web program

PHP Add Module Implementation acceleration:

[Epel]php-xcache provides PHP driver

Execute PHP Code: scan[Syntax]-->parsing[lexical--expression]--complie[expression-->opcode]--exec

Php-xache can be implemented, cache opcode, process can be used between each other opcode

Second, storage and protocol
  • Store
    • File:syscall

    • SQL storage: (MySQL branch, Oracle, MSSQL) 驱动

      MySQL branch: MySQL, mariadb, Percona-server, Pgsql (enterprisedb)

    • Nosql:mongodb, HBase, Redis

    • Newsql: Distributed mode management storage engine

  • Protocol: Relational model, RDMBS, SQL protocol, data storage protocol
  1. Relational Model: Table (ROW:2NF, COLUMN:1NF)

    实现: DBMS (Mysql, MariaDB)

    Data structure: Hierarchy, mesh, relational model

    Classification of relational models:

    Basic-Relational model entity-relation model based on object-relation model semi-structure-relational model supports XML parsing data
  2. RDBMS: The design paradigm of satisfying relational database

    实现: SQL Store (MySQL branch, Oracle, MSSQL)

    MySQL branch: MySQL official, mariadb Open source, Percona-server famous, Pgsql (enterprisedb) Oracle: Traditional Company: What's the use of a high-level radio when it comes to smartphones? Ms_sql: Microsoft

    Design paradigm:

    "1NF": Atomic atomicity, for example: A field that contains classes and majors, is not allowed "2NF": There are only a limited number of fields within the line that uniquely identify this line, "3NF": 2 tables with the same field, 1 table fields must be primary keys such as: Table 1: Professional: Non-primary key table 2: Major: Primary key

    Satisfying paradigm:

    "Split table": Splitting a large data set into small tables, the table must satisfy the paradigm "union": Join, based on index, algorithm "DataSet": a library, a schema, a collection

    Table: Define column first, then row

    There can be no row, there must be column

    Structure:

    SQL Engine: Perform [scan], analyze [parsing], solve [solution], optimize [Select Path | Modify path result unchanged] "transaction: Multiple operations are complete or not complete (atomicity atomicity, consistency consistency, isolating isolation Durability persistence) Recovery: Synchronizing data in the transaction log to a data area lock: Write (Own RW, others:-) read (self: R, others: R) space management, buffering, file access interface
  3. SQL protocol: structure query Language Structured Query Language

    implement : SQL engine or SQL interpreter SQL Engine (SQL Protocol): command run, function, variable

  4. Data storage Protocol:

    c/S architecture, MySQL protocol, MARIADB protocol, Oracle Protocol, MSSQL Protocol (SQL Server)

    实现

    Client: Program: CLI (MySQL), GUI (phpMyadmin) Api:sql interface, Php-mysql, ODBC (underlying library) **API: Write program-oriented object: Hardware specification, assembly, Syscall, Li Bcall Server: Listen for sockets, receive, process, and respond to user requests
Third, the realization of open source RDBMS mysql/mariadb basic knowledge
MariaDB
Sources of MARIADB

Author developed SQL Interface: founded AB (Swedish company), MySQL

Mysql-->google,facebook improved-->sun acquisition-->oracle acquisition sun-->

MySQL pronunciation: ' My ' SQL '

The author is reluctant to: Another stand: MariaDB Maria: Daughter's name

Why Oracle is acquiring Sun

Oracle cannot provide an 硬件到软件到系统 integrated solution, and IBM BIG BLUE can, in order to rival IBM, acquire Sun

Constraints: The limits to be adhered to for data being inserted

Constraint type:

  • 主键约束: Inserts data, uniquely identifies the bank. Not NULL, the only

  • 惟一键: Inserts data, uniquely identifies the bank. NULL, inflexible a

  • 外键约束: This table inserts content, depending on the primary key of another table

  • 检查性约束: field definition expression, inserting data must satisfy an expression

Indexes: Extracting subsets of data, sorting

Dense, sparse:1对1 or 1对多

Simple, combination: 索引字段是1个或多个

Clustered, non-clustered:索引字段与数据是否在一起

Relational operations: Extracting data sets

Select, select Row,WHERE

Projection, select column, SELECT

Connectionjoin

Data abstraction: by perspective

View layer: view You can only see part of the database: improving the user experience

Logical layer: 元数据 , dependency

Physical layer: 据存储格式 : The correspondence between tables and files

MySQL Installation:

SOURCE rpm

Program official/Project official: Source code and Binary program

OS Vendor System installation CD: RPM 稳定

Grateful
    • Brother Rui QQ, blog

    • qq:2580259468

    • Blog

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/07/C3/wKiom1nPLnDSJM8yAABpHaLUCWY511.png "title=" Qq20170927224449.png "alt=" Wkiom1nplndsjm8yaabphalucwy511.png "/>

About the author
    • Email: [Email protected]

    • qq:2192383945


This article is from the "Reading" blog, make sure to keep this source http://sonlich.blog.51cto.com/12825953/1969965

+++++++php components, SQL components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.