Take you ten days to easily handle the Go micro service series
preface
We will show you a go zero micro service example in detail through a series of articles. The whole series is divided into ten articles, and the directory structure is as follows:
Environment construction
Service splitting
User services
Product service
Order service
Payment services (this article)
RPC service Auth authen ...
Added by davestevens_uk on Thu, 27 Jan 2022 01:46:24 +0200
MySQL method to avoid inserting duplicate records
In case of primary key conflict or unique key conflict in mysql, there are generally three avoidance methods according to different insertion strategies.
1,insert ignore
2,replace into
3,insert on duplicate key updateNote that unless the table has a PRIMARY KEY or UNIQUE index, using the above three statements is meaningless, which is the same ...
Added by kontesto on Wed, 26 Jan 2022 23:45:49 +0200
Day517. Index optimization and query optimization mysql
Index optimization and query optimization
1, Data preparation
Insert 500000 entries in the student table and 10000 entries in the class table.
Step 1: create a table
#Class table
CREATE TABLE `class` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`className` VARCHAR(30) DEFAULT NULL,
`address` VARCHAR(40) DEFAULT NULL,
`monitor` INT NULL ,
PRIMARY ...
Added by gnetcon on Wed, 26 Jan 2022 21:19:06 +0200
Wan Da #21, how to check the connection of MySQL database for a period of time
The original content of GreatSQL community cannot be used without authorization. Please contact Xiaobian and indicate the source for reprint.View modeIt is known that there are at least two ways to achieve this1. Turn on general_log can be observedOpen commandmysql> set global general_log=ON;Perform some operations[root@mgr2 ~]# mysql -uGrea ...
Added by topflight on Wed, 26 Jan 2022 19:50:57 +0200
Sorting and paging
Sorting of data
If sorting operation is not used, the data returned by query is displayed in the order of adding data by default.
Sorting using the ORDER BY clause
ASC (ascend): ascending (default)DESC (descend): descending
The ORDER BY clause is at the end of the SELECT statement.
Single column sorting
For example:
# Display employe ...
Added by HSM on Wed, 26 Jan 2022 18:07:34 +0200
Chapter 04_ operator
1. Arithmetic operator
Arithmetic operators are mainly used for mathematical operations. They can connect two values or expressions before and after the operator, and perform addition (+), subtraction (-), multiplication (*), division (/) and modulus (%) operations on the values or expressions.
1. Addition and subtraction operators
mysql> S ...
Added by MelbourneFL on Wed, 26 Jan 2022 09:48:49 +0200
sql statements commonly used by software testers
MySQL database
1. MySQL built-in functions
1.1 string function
1.1.1 concat splicing string function
concat (parameter 1, parameter 2, parameter 3, parameter n)
Parameters can be numbers or stringsConcatenate all parameters into a complete string
Example 1: put 12334,'ab'Splice into a string'12334ab'
select concat(12, 334, 'ab');
...
Added by Cinds on Wed, 26 Jan 2022 06:40:51 +0200
Chapter IV open source projects and deployment
File and data storageRun todo projectEnter app directoryapp
├── Dockerfile
└── spec
└── src
└── yarn.lockSource code download: Getting started source code compressed packageNew DockerfileFROM node:12-alpine
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache python3 g++ make
RUN ...
Added by Chadian22 on Wed, 26 Jan 2022 06:11:58 +0200
MySQL foundation -- teacher Han Shunping's class
24.23 total / statistical function
24.23.1 count
--How many students are there in a class?
--How many students have statistical mathematics scores greater than 90?
--How many people have a total score of more than 250?
--Difference between count(*) and count (column)
--Explanation: count(*) returns the number o ...
Added by waq2062 on Tue, 25 Jan 2022 21:24:47 +0200
Comment table design - path enumeration, nested set, closure table
scene
Imagine that there is a requirement: design a comment system that requires users to comment on articles and reply to each other, without the limit of level.(the adjacency list most commonly used by programmers will not be discussed here. Partners can baidu by themselves.)
Path Enumeration
Path enumeration is a complete path composed of ...
Added by paulieo10 on Tue, 25 Jan 2022 20:43:41 +0200