Distributed Day01

1. Jingtao project architecture design
1.1 Internet architecture design features
1.1.1 Highly concurrent

    users access the server in large numbers at the same time. Tomcat server concurrency capacity: 200-250 (JVM tuning 1000) Hardware conditions: Physical server processing capacity Network bandwidth .
1
1.1.2. Distributed
    1). Distributed computing
            consists of multiple threads that work together to complete a specific task. Disassembly and assembly issues
    2. Do not put eggs in a distributed system
            into one basket (distributed).
            tomcat server You can prepare multiple units and deploy them to different locations to prevent the impact of power outages.

1.1.3. Cluster
        Building a tomcat server cluster is an effective means to combat high concurrency.
1.1.4. High availability (HA)
     Generally, high availability is set up in the cluster. When a server exception occurs, the program can automatically migrate the fault without human intervention.
1
1.1.5. Data security
General data security needs to prevent hackers and ensure database security. Sex/Data Backup/Automatically Complete Backup.
Alibaba: Technology Company

1.2 Jingtao project architecture design

Insert image description here
2. Database table design
2.1 Database table relationship
Core: Consider the problem from one perspective.

 

 

2.1.1 One-to-one
User and Department A user has only one department, so one-to-one
User and user details One user corresponds to one detail One-to-one One
detail corresponds to one user One-to-one

Insert image description here
2.1.2 One-to-many
department and user There are multiple users under one department and one-to-many

 Insert image description here

 


2.1.3 Many-to-many
Case:
1. Roles and permissions. One role corresponds to multiple permissions.
One permission corresponds to multiple roles.
Number of tables: Generally, many-to-many has three tables with the participation of intermediate tables.

Insert image description here
2.2 Jingtao watch design

 Insert image description here

 


2.3 Import data table
2.3.1 Install database tools

Insert image description here
2.3.2 Create database link

Insert image description here 

 


2.3.3 Import database
1). Import database

Insert image description here

 

2).Add database file

Insert image description here

 

3).Operating data table

Insert image description here
3. SpringBoot Advanced Usage
3.1 About Maven Review
3.1.1 What is Maven
Maven is a one-stop project management tool. It includes project building/project running/project packaging/project release and other functions.
1

 Insert image description here

 


3.1.2 Check the local warehouse location
1).maven configuration file location The configuration path is optional but the location needs to be fixed

Insert image description here
2).Check the local library address

 Insert image description here

 


3). Check the private server mirror address

 <mirror>
    <id>aliyun</id>
    <name>aliyun for maven</name>
    <mirrorOf>*</mirrorOf>
    <url>https://maven.aliyun.com/repository/public</url>
   < /mirror>

3.1 IDEA environment configuration
3.1.1 Install lombok plug-in

Insert image description here
3.1.2 Install Spring tool package

 Insert image description here

 


3.1.3 Modify zoom

Insert image description here
3.1.4 Configure case prompts

Insert image description here 

 


3.1.5 Parameter prompt

Insert image description here
3.1.6 Add automatic compilation

 Insert image description here

 


3.1.7 Configuration automatic saving (version differences)

Insert image description here
3.1.8 Configure maven environment

 Insert image description here

 


3.2 JDK check

Insert image description here
3.3 SpringBoot Getting Started Case
3.3.1 Creating a Project

 Insert image description here

 


3.3.2 Select the jar package.
Due to the entry-level case, no other packages are needed for the time being.

Insert image description here
3.3.3 maven command description
1). The install command
generates jar/war packages according to the coordinates of the project.

Insert image description here 

 

2).clean deletes the target file directory and content in the project.
3).compile compiles the .java file into a .class file and is generally used in development. If you need to package and deploy, use install directly.

3.3.4 Project release
command: java -jar xxx.jar

Insert image description here

 

Universal cancel key combination: CTRL + C

3.4 Overall project development process
Party A (Dad) ----------> Tendering (good public relations department) -------> Project Manager (Commander) -------> OK Team (Product Department/Design Department/R&D Department/Testing Department/Implementation Department/Operation and Maintenance Department)------>The product manager is responsible for drawings (prototype drawings – business logic)-------->UI Design----------->WEB development engineer-------->Back-end development engineer----->Tester-->Operation and maintenance personnel.

4. Instructions for SpringBoot editing items
4.1 Description of POM.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0. 0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache .org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!--
        Project coordinates: The jar/war package generated in the future will be stored in the specified directory.
        Function: It is convenient to find the jar package of the project in the form of coordinates.
    -->
    <!--The group ID definition is generally written upside down by the company domain name. -->
    <groupId>com.jt</groupId>
    <!--Project ID: Generally defined project name must be unique-->
    <artifactId>springboot_demo1</artifactId>
    <!--Version number-->
    <version>0.0 .1-SNAPSHOT</version>
    <name>springboot_demo1</name>
    <description>Demo project for Spring Boot</description>

    <!-- The PARENT tag defines         the configuration information of
        the version numbers of all dependent jar packages in the major version of springBoot2.4.1.         Old projects: jar packages are particularly prone to conflicts     -->     <parent>         <groupId>org.springframework .boot</groupId>         <artifactId>spring-boot-starter-parent</artifactId>         <version>2.4.1</version>         <relativePath/> <!-- lookup parent from repository -->     </parent>









    <properties>
        <!--Define the jdk version when the current project is running-->
        <java.version>1.8</java.version>
        <!--Skip test class packaging-->
        <skipTests>true</skipTests>
    < /properties>

    <dependencies>
        <!--Question 1: When the program resolves to dependency, the program loads the jar package file???
            Description: According to the coordinates of the dependency, go to the local warehouse to find the jar package file at the specified location
            and then make the dependency.
        -->

        <!--Question 2: The jar package in maven has transitive
            dependency: A depends on B, and B depends on C.
            When A is dependent on A, B/C will be automatically added.

            Implementation principle:
                The maven tool coordinates first loads the jar package file. However, the jar package file itself is a
                maven project. Therefore, the maven program will load the xxx.pom of the jar package file
                for analysis and then add additional packages. At this point, the dependency is realized Transitivity.
        -->

        <!--Question 3: How to ensure the security of the jar package file from being tampered with by others.
            File encryption: md5 encryption/sha1 algorithm
            Answer: Use the sha1 algorithm to dynamically generate a summary of the file, and then compare it with the original server data
        -->
        < dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


4.2 SHA1 algorithm description
SHA-1 (English: Secure Hash Algorithm 1, Chinese name: Secure Hash Algorithm 1) is a cryptographic hash function designed by the US National Security Agency and released by the US National Institute of Standards and Technology (NIST) Federal Data Processing Standards (FIPS). SHA-1 can generate a 160-bit (20-byte) hash value called a message digest. The hash value is usually presented as 40 hexadecimal digits.
Hexadecimal number: 0-9 AF +1 after full compound. Is the result repeated???

Common sense:
1). If you perform hash calculation on the same data, are the values ​​the same? Same
2). If you perform hash calculation on different data, are the values ​​the same? It may be the same hash collision!!!
3). One file is 1M, one File 1G. Which speed of hash calculation is faster? A. Same speed (theoretical value)
time complexity O(1)

Insert image description here

Guess you like

Origin blog.csdn.net/qq_41819851/article/details/130309815