Last updated on 20180502
- data structure
- Common algorithms
- Concurrent
- operating system
- Design Patterns
- Operation & Statistics & Technical Support
- Middleware
- The internet
- database
- search engine
- performance
- Big Data
- Safety
- Common open source framework
- Distributed design
- Design Ideas & Development Models
- Project management
- General Business Terms
- Technical trends
- Policies and regulations
- Architect quality
- Team management
- Information
- Technical resources
(Toc generated by simple-php-github-toc )
-
"java queue - detailed analysis of queue"
- Non-blocking queue: ConcurrentLinkedQueue (unbounded thread safe), using CAS mechanism (compareAndSwapObject atomic operation).
- Blocking queues: ArrayBlockingQueue (bounded), LinkedBlockingQueue (unbounded), DelayQueue, PriorityBlockingQueue, using lock mechanism; use ReentrantLock lock.
-
"LinkedList, ConcurrentLinkedQueue, LinkedBlockingQueue Comparative Analysis"
- "Stack design and implementation of java data structure and algorithm"
- Java Stack Class
- "Detailed Implementation Analysis of Java Stack"
- Stack is thread-safe.
- Internal use array to save data, double when not enough.
Each node has a maximum of two leaf nodes.
- Complete Binary Tree
- The leaf nodes can only appear at the bottom and sub-lower levels, and the nodes at the bottom level are all concentrating on the binary tree at the leftmost position of the layer.
The absolute value of the height difference between the left and right two subtrees does not exceed one, and both the left and right subtrees are balanced binary trees.
- "On Data Structure - Balanced Binary Tree"
- "On the algorithm and data structure: eight balanced tree search 2-3 tree"
Binary Search Trees, also called ordered binary trees, are sorted binary trees.
- "Easiest to understand red and black trees"
- After the addition phase, left-handed or right-handed to reach equilibrium again.
- "On Algorithms and Data Structures: Nine Balanced Search Trees for Red and Black Trees"
MySQL is based on the B+ tree clustered index organization table
- "B-tree, B+ tree, B* tree"
- "Comparison of the advantages and disadvantages of B-trees, B+ trees and B* trees"
- The tree structure of the leaf nodes of the B+ tree is more convenient than the B-tree for scanning and range retrieval.
Compared with B+ trees, LSM (Log-Structured Merge-Trees) sacrifices partial read performance in exchange for write performance (through batch writes) and achieves read and write. Hbase, LevelDB, Tair (Long DB), and nessDB use the structure of the LSM tree. LSM can quickly establish an index.
-
- The B+ tree read performance is good, but due to the need for an orderly structure, the disk seeks frequently when the keys are scattered, resulting in write performance.
- LSM divides a large tree into N small trees, first writes to memory (without seeking problems, high performance), and builds an ordered small tree (ordered tree) in memory. The bigger the memory tree is flushed to disk. When reading, because it does not know which tree the data is on, it is necessary to traverse (bi-search) all the small trees, but the data is ordered inside each small tree.
-
LSM Tree (Log-Structured Merge Tree Storage Engine)
- In extreme terms, the write performance of HBase based on the LSM tree is an order of magnitude higher than that of MySQL, and the read performance is an order of magnitude lower.
- Optimization method: Bloom filter replaces binary search; compact decimal tree, improves query performance.
- In Hbase, when the memory reaches a certain threshold, the entire flush flushes to disk and forms a file (B+ number). HDFS does not support the update operation. Therefore, Hbase does an overall flush instead of a merge update. Flush to the small tree on the disk, periodically merged into a big tree.
It is often used for checking the weight of large-scale data.
- "Selection Sort of Classic Algorithms in Java"
- Each tick selects the smallest element from the records to be sorted, and the order is placed at the end of the sorted sequence until all records are sorted.
- "Two kinds of writing bubble sorting"
- Exchange adjacent elements before and after, the largest row to the end.
- Time complexity O(n2)
- Sitting on the toilet looking algorithm: quick sort
- One side is larger or smaller than the other.
- "Image Sorting Algorithm (4) Merge and Sorting"
- Divide and conquer, sort into small parts and merge (recreate a new space for copying).
TODO
- "Graphical sorting algorithm (three) of the heap sort"
- The sorting process is the process of building a maximum heap. The maximum heap: The value of each node is greater than or equal to the value of its child nodes, and the top element is the maximum value.
- Counting and Bucket Sorting
- Compared to the bucket sorting process, the difference lies in the number of buckets.
- "[Aha! Algorithms] The Fastest and Simplest Sorting - Bucket Sorting
- "Sort Algorithm (3): Counting and Bucket Sorting"
- Bucket sorting divides the [0,1) interval into n sub-intervals of the same size, which are called buckets.
- Each bucket is sorted individually and then it traverses each bucket.
Sort by rank, ten, hundred, ...
-
"Two-point search (java implementation)"
- The sequence to be searched is ordered.
- Time complexity O(logN).
-
"java realize binary search - two ways"
- While + recursively.
- Analysis of Arrays.sort and Collections.sort Implementation Principles
- The Collections.sort algorithm calls the merge sort.
- Arrays.sort() uses two sorting algorithms -- basic sort data using quick sorting, and object arrays using merge sorting.
Commonly used for big data, such as email, url, etc. Core principle: Generate a fingerprint (a byte or bytes, but certainly a lot less than the original data) by calculating each piece of data, each of which is obtained by random calculation, mapping the fingerprint to a large The bitwise storage space. Note: There will be a certain error rate. Advantages: High space and time efficiency. Disadvantages: As the number of deposited elements increases, the miscalculation rate increases.
- Bloom Filter - Spatially Efficient Data Structure
- "Large Data Deduplication: Bitmap and Bloom Filters"
- "The Implementation of Bloom Filter Based on Redis"
- Redis-based Bitmap data structure.
- "Web crawler: Use of Bloom filter for URL deduplication policy"
- Use the BitSet class and weighted hashing algorithm in Java.
KMP: The core principle of the Knuth-Morris-Pratt algorithm (abbreviated as KMP) is to use a "partial match table" to skip over elements that have already been matched.
- "Algorithm: Fundamentals of Greedy Algorithm"
- "Common Algorithms and Problem Scenarios - Greedy Algorithm"
- "Detailed Explanation of Dynamic Planning - Zou Bo Talks about Dynamic Planning"
- "Personal Understanding of Dynamic Programming Algorithms"
-
"Take You Through the Naive Bayes Classification Algorithm"
- P(B|A)=P(A|B)P(B)/P(A)
-
Basic knowledge
1.1 advantages and disadvantages of concurrent programming
Knowledge points: (1) Why use concurrency? (Advantages); (2) Disadvantages of concurrent programming; (3) Confusing concept
1.2 Thread Status and Basic Operations
Knowledge points: (1) how to create new threads; (2) thread state transitions; (3) basic thread operations; (4) daemon threads;
-
Concurrency Theory (JMM)
Java memory model and happens-before rules
Knowledge points: (1) JMM memory structure; (2) reordering; (3) happens-before rules
-
Concurrent Keyword
3.1 Let you thoroughly understand Synchronized
Knowledge points: (1) how to use synchronized; (2) monitor mechanism; (3) synchronized happens-before relationship; (4) synchronized memory semantics; (5) lock optimization; (6) lock escalation strategy
3.2 Let you thoroughly understand volatile
Knowledge points: (1) implementation principle; (2) derivation of happens-before relations; (3) memory semantics; (4) realization of memory semantics
3.3 Do you think you really understand final?
Knowledge points: (1) how to use; (2) final reordering rules; (3) final implementation principles; (4) final references cannot "overflow" (this escape) from constructors
3.4 Summary of the three major properties: atomicity, orderliness, visibility
Knowledge points: (1) atomicity: synchronized; (2) visibility: synchronized, volatile; (3) orderliness: synchronized, volatile
-
Lock system
4.1 Meet Lock and AbstractQueuedSynchronizer (AQS)
Knowledge points: (1) Lock and synchronized comparisons; (2) AQS design intent; (3) How to implement custom synchronization components using AQS; (4) Rewritable methods; (5) Template methods provided by AQS;
4.2 In- depth understanding of AbstractQueuedSynchronizer (AQS)
Knowledge points: (1) AQS synchronization queue data structure; (2) exclusive lock; (3) shared lock;
4.3 Understanding ReentrantLock Again
Knowledge points: (1) implementation principle of reentrant locks; (2) implementation principle of fair locks; (3) implementation principle of non-fair locks; (4) comparison of fair locks and non-fair locks
4.4 In- depth understanding of the read-write lock ReentrantReadWriteLock
Knowledge points: (1) How to represent read/write status; (2) WriteLock acquisition and release; (3) ReadLock acquisition and release; (4) lock downgrading strategy; (5) Generation of Condition wait queues; (6) Application scenarios
4.5 Detailed conditions await and signal wait / notification mechanism
Knowledge points: (1) Features that are comparable to the wait/notify mechanism of Object; (2) Methods corresponding to wait/notify of Object; (3) Underlying data structures; (4) Await implementation principles; (5) Signal/signalAll implementation principle; (6) combination of await and signal/signalAll;
4.6 LockSupport Tool
Knowledge points: (1) main functions; (2) characteristics compared to synchronized blocking wake-up;
-
Concurrent container
5.1 concurrent containers ConcurrentHashMap (JDK 1.8 version)
Knowledge points: (1) key attributes; (2) important internal classes; (3) CAS operations involved; (4) construction methods; (5) put execution flow; (6) get execution flow; (7) expansion mechanism (8) Execution flow of method for counting size; (9) Comparison of ConcurrentHashMap version 1.8 with previous version
5.2 CopyOnWriteArrayList of Concurrent Containers
Knowledge points: (1) realization principle; (2) difference between COW and ReentrantReadWriteLock; (3) application scenario; (4) why there is weak consistency; (5) shortcomings of COW;
5.3 ConcurrentLinkedQueue for Concurrent Containers
Knowledge points: (1) implementation principle; (2) data structure; (3) core method; (4) design intent of delayed update of HOPS
5.4 concurrent container ThreadLocal
Knowledge points: (1) implementation principle; (2) set method principle; (3) get method principle; (4) remove method principle; (5) ThreadLocalMap
An article, from the source code in-depth detailed ThreadLocal memory leak problem
Knowledge points: (1) ThreadLocal memory leak principle; (2) ThreadLocal best practices; (3) application scenarios
5.5 Concurrent Container BlockingQueue
Knowledge points: (1) Basic operation of BlockingQueue; (2) Commonly used BlockingQueue;
Concurrent container ArrayBlockingQueue and LinkedBlockingQueue implementation principle explained
-
Thread pool (Executor system)
6.1 Thread Pool Implementation Principle
Knowledge points: (1) Why use a thread pool? (2) execution flow; (3) the meaning of each parameter of the constructor; (4) how to close the thread pool; (5) how to configure the thread pool;
6.2 Thread Pool ScheduledThreadPoolExecutor
Knowledge points: (1) class structure; (2) common methods; (3) ScheduledFutureTask; (3) DelayedWorkQueue;
6.3 FutureTask Basic Operation Summary
Knowledge points: (1) Several states of FutureTask; (2) get method; (3) cancel method; (4) application scenario; (5) implementation of Runnable interface
-
Atomic operations
7.1 Atomic Operation Classes in Atomic Packages in Java
Knowledge points: (1) implementation principle; (2) atomic update basic types; (3) atomic update array types; (4) atomic update reference types; (5) atomic update field types
-
Concurrency tools
8.1 Big vernacular Java Concurrency Tool - CountDownLatch, CyclicBarrier
Knowledge Points: (1) CountDownLatch, (2) CyclicBarrier, and (3) Comparison between CountDownLatch and CyclicBarrier
8.2 Big vernacular Java Concurrency Tools - Semaphore, Exchanger
Knowledge Points: (1) Resource Access Control Semaphore; (2) Data Exchange Exchanger
-
Concurrent practice
9.1 An article that lets you thoroughly understand the producer-consumer problem
JAVA concurrent knowledge map
Move to a new window, zoom in to see better results or view originals
Knowledge map artwork link, if useful, can be cloned for use
-
Uncommitted read: A transaction can read another uncommitted data and is prone to dirty reads.
-
Read submission: A transaction can read data only after another transaction has been submitted, but a non-repeatable read situation occurs (the read data is inconsistent), and an UPDATE operation occurs during the read process. (The default level for most databases is RC, such as SQL Server, Oracle), which cannot be changed when reading.
-
Repeatable reading: The same transaction ensures that the same data is obtained for each read, but does not guarantee that the original data is updated (phantom read) by other transactions. Mysql InnoDB is this level.
-
Serialization: serial processing of all things (sacrificing efficiency)
-
Four characteristics of database transactions and transaction isolation levels
-
"InnoDB's phantom reading problem"
- The example of phantom reading is very clear.
- Solve with SELECT ... FOR UPDATE.
-
"An article with you to read MySQL and InnoDB"
- Graphical dirty reading, non-repeatable reading, phantom reading problems.
-
"[mysql] some understanding of MVCC in innodb"
- The MVCC in innodb is used at the Repeatable-Read isolation level.
- MVCC produces phantom issues (updated exceptions.)
-
"Easy understanding MYSQL MVCC implementation mechanism"
- MVCC control is achieved by hiding the version column, a record creation time, a record deletion time, and the time
- Only operate on lines that are smaller (or equal) than the current version.
-
- Mainly includes synchronized, ReentrantLock, and ReadWriteLock.
-
- Quantity control
- Apply with acquire, apply for not blocked; release with release.
-
"Mutex vs Semaphore in Java Development"
- Simply put, Mutex is exclusive. Only one resource can be obtained. Semaphore is also exclusive, but it can define multiple objects that can be accessed.
The role of the fair lock is to execute in strict accordance with the order in which the threads are started, and no other thread is allowed to queue execution; non-fair locks are allowed to be queued.
- Fair and Unfair Locks
- ReentrantLock and synchronized are both non-fair locks by default. ReentrantLock can be set to fair lock.
Pessimistic locking, if used improperly (with too many locks), can cause large areas of service to wait. It is recommended to use optimistic locking + retries first.
-
"[MySQL] Pessimistic Lock & Optimistic Lock"
- Optimistic locking method: version number + retry method
- Pessimistic locking: row locking via select ... for update (unreadable, non-writable, and share lock read-unreadable).
-
"Mysql query statement using select.. for update database deadlock analysis"
- Although the innodb storage engine oracle's intrinsic lock is a lock line, it is internally locked.
- Different index conditions that lock the same data can cause deadlocks.
- "An Optimistic Lock Implementation - CAS"
- It is similar to the MySQL optimistic lock method, but it is compared with the original value.
Due to high concurrency, under CAS, this A may not be A after updating. It can be solved by the version number, similar to the optimistic lock mentioned in Mysql above.
- Java CAS and ABA Issues
- "ABA Problems and Avoidance in Java"
- AtomicStampedReference and AtomicStampedReference.
Concurrent reads can be made to the CopyOnWrite container without the need for locking. The CopyOnWrite concurrent container is used to read multiple writes and fewer concurrent scenes. For example, whitelists, blacklists, and visits and update scenarios for product categories are not suitable for scenarios that require strong data consistency.
-
"Copy-On-Write Map Implementation in JAVA"
- Reading and writing are separated, reading occurs on the original data, and writing occurs on the copy.
- Without locking, consistency is finally achieved through consistency.
-
Reentrant and Non-Reentrant Locks
- Examples of reentrant locks and non-reentrant locks are illustrated by simple code.
- Reentrant locks mean that the same thread can regain previously acquired locks.
- Reentrant locks allow users to avoid deadlocks.
- Reentrant locks in Java: synchronized and java.util.concurrent.locks.ReentrantLock
-
"ReenTrantLock reentrant lock (and the difference between synchronized) summary"
- Synchronized easy to use, the compiler to lock, is a non-fair lock.
- ReenTrantLock is flexible and lock fairness can be customized.
- In the same locked scenario, it is recommended to use synchronized.
Mutexes: Only one thread can acquire a lock at the same time. For example, ReentrantLock is a mutex, and write locks in ReadWriteLock are mutexes. Shared locks: There can be multiple or simultaneous locks. For example, Semaphore, CountDownLatch are shared locks, and read locks in ReadWriteLock are shared locks.
-
"Reasonable explanation of the four necessary conditions for "deadlock"
- Mutually exclusive, held, inalienable, inalienable.
-
How can Java view the deadlock?
- JConsole recognizes deadlocks.
-
Java multi-threaded series: deadlock and detection
- Jstack can display deadlocks.
A typical CPU has three levels of cache. The closer it is to the core, the faster and the smaller the space. L1 is generally 32k, L2 is generally 256k, and L3 is generally 12M. The memory speed requires 200 CPU cycles and the CPU cache requires 1 CPU cycle.
TODO
- "Terminating Python Coroutines--Implementation from Yield to actor Model"
- Thread scheduling is the responsibility of the operating system. Coroutine scheduling is the responsibility of the program.
- Compared with threads, coroutines reduce unnecessary operating system switching.
- In fact, when switching to an IO operation is more meaningful, (because the IO operation does not occupy the CPU), if no IO operation is encountered, switch according to the time slice.
- The Six Principles of Design Patterns
- The principle of opening and closing: open to the extension, close to the modification, use more abstract classes and interfaces.
- Lie substitution principle: the base class can be replaced by subclasses, use abstract class inheritance, do not use concrete class inheritance.
- Relying on the principle of reversal: to rely on abstraction, not relying on the specific, programming for the interface, not for programming.
- Interface isolation principle: Using multiple isolated interfaces is better than using a single interface to establish a minimal interface.
- Dimit's Law: A software entity should interact with other entities as little as possible and establish links through intermediate classes.
- Synthetic reuse principles: Use synthetic/aggregate as much as possible instead of using inheritance.
-
"Detailed Design Patterns in the JDK"
-
Structural mode:
- Adapter: Used to convert an interface to another interface, such as java.util.Arrays#asList().
- Bridge mode: This mode decouples the implementation of abstract and abstract operations, so that the abstraction and implementation can be independently changed, such as JDBC;
- Combined mode: Makes the client seem to have the same combination of individual objects and objects. In other words, a certain type of method also accepts its own type as parameters, such as Map.putAll, List.addAll, Set.addAll.
- Decorator pattern: Dynamically adds an extra function to an object, which is an alternative to subclasses, such as java.util.Collections#checkedList|Map|Set|SortedSet|SortedMap.
- Fragmentation mode: use caching to speed up the access time of a large number of small objects, such as valueOf(int).
- Proxy mode: The proxy mode is to replace a complex or time-consuming object with a simple object, such as java.lang.reflect.Proxy
-
Create mode:
- Abstract factory pattern: The abstract factory pattern provides a protocol to generate a series of related or independent objects without specifying the concrete object type, such as java.util.Calendar#getInstance().
- Builder: A new class is defined to build an instance of another class to simplify the creation of complex objects such as: java.lang.StringBuilder#append().
- Factory method: that a return * back to the specific object methods, rather than several, such as java.lang.Object # toString (), java.lang.Class # newInstance ().
- Prototype mode: Makes an instance of a class generate its own copy, such as: java.lang.Object#clone().
- Singleton mode: There is only one instance globally, such as java.lang.Runtime#getRuntime().
-
Behavior pattern:
- Chain of Responsibility: By delegating requests from an object to the next object in the chain until the request is processed, decoupling between objects is achieved. Such as javax.servlet.Filter#doFilter().
- Command mode: encapsulates operations into objects for storage, delivery, and return, such as: java.lang.Runnable.
- Interpreter mode: defines the syntax of a language, and then parses the corresponding syntax statement, such as java.text.Format, java.text.Normalizer.
- Iterator mode: Provides a consistent method for sequentially accessing objects in a collection, such as java.util.Iterator.
- Mediator pattern: java.lang.reflect.Method#invoke() by using an intermediate object for message distribution and reducing the direct dependency between classes.
- Empty object patterns: such as java.util.Collections#emptyList().
- Observer pattern: It allows an object to send messages to interested objects flexibly, such as java.util.EventListener.
- Template method pattern: Allows subclasses to override part of the method instead of the entire rewrite, such as java.util.Collections#sort().
-
- Three Implementations of the Singleton Model and Their Advantages and Disadvantages
- Singleton Pattern - Reflection - Preventing Serialization from Destroying Singleton Patterns
- Use enumeration types.
TODO
- "MVC Mode"
- Model - view - controller
- Understanding the IOC
- "ICO Understanding and Interpretation"
- Positive control: Tradition through new. Reverse control, inject the object through the container.
- Role: For module decoupling.
- DI: Dependency Injection, that is, dependency injection, is only concerned with resource usage and does not care about the source of resources.
- Easy to understand AOP (face-oriented programming)
- "Spring AOP Detailed"
- "Spring AOP Implementation Principles"
- The dynamic proxy used by Spring AOP is mainly in two ways: JDK dynamic proxy and CGLIB dynamic proxy.
- Spring AOP Implementation Principles and CGLIB Applications
- The principle of handling the AOP proxy class in the Spring AOP framework is: If the target object's implementation class implements the interface, Spring AOP will use the JDK dynamic proxy to generate the AOP proxy class; if the target object's implementation class does not implement the interface, Spring AOP will Use CGLIB to generate AOP proxy classes
-
"The Theoretical Basis of Microservice Architecture - Conway's Law"
- Rule One: Organizational communication methods will be expressed through system design, which means that the layout and organizational structure of the architecture will be similar.
- Law 2: Time is not possible to do more perfect one thing, but there is always time to finish one thing. Can't get fat in one go, but you can get it first.
- Law 3: There are potentially heterogeneous homomorphic characteristics between linear systems and linear organizational structures. Get melons and become independent autonomous subsystems to reduce communication costs.
- Law 4: Large system organizations are always more decomposed than small systems. All the time will be divided, divide and rule.
-
"Tencent Business System Monitoring Practice Road"
- Monitoring methods: active, passive, bypass (such as public opinion monitoring)
- Monitoring type: Basic monitoring, server monitoring, client monitoring, monitoring, customer monitoring
- Monitoring objectives: full, block, accurate
- Core indicators: request volume, success rate, time-consuming
-
"Open source or commercial? Top Ten Yunyunwei Monitoring Tools Hengping Review
- Zabbix, Nagios, Ganglia, Zenoss, Open-falcon, Monitor Po, 360 Website Service Monitoring, Alibaba Cloud Monitoring, Baidu Cloud Observation, Little Bee Website Monitoring, etc.
-
"Monitoring alarm system construction and secondary development experience"
Command line monitoring tool
-
"Common command line monitoring tool"
- Top, sar, tsar, nload
-
"Detailed Usage of JVM Performance Tuning Monitoring Tools jps, jstack, jmap, jhat, jstat, hprof"
APM — Application Performance Management
-
The main open source software, alphabetically sort
-
"Open source APM technology selection and actual combat"
- Mainly based on Google's Dapper (large-scale distributed system tracking system) idea.
-
"The basis of traffic statistics: buried point"
- Common metrics: visits and visitors, length of stay, bounce rate, exit rate, conversion rate, engagement
-
"Statistical tools, buried targets and buried contents commonly used by APP sites"
- Third-party statistics: UFIDA, Baidu Mobile, Rubik's Cube, App Annie, talking data, and other data.
-
"The United States Mission Review front-end no trace buried practice"
- The so-called no trace, that is, the acquisition node is configured through a visualization tool, and the front end automatically analyzes the configuration and reports buried data, instead of hard coding.
Development, testing, and production environment separation.
- Ansible Chinese Authoritative Guide
- "Ansible Basic Configuration and Enterprise Project Practical Cases"
- Deep Interpretation - TDD (Test Driven Development)
- Based on test case coding function code, XP (Extreme Programming) core practice.
- Benefits: Focus on one point at a time, reduce the burden of thinking; meet changes in demand or improve code design; clarify requirements in advance;
- "Java Unit Testing JUnit"
- "Compare JUnit 4 with TestNG"
- TestNG overrides JUnit features for more complex scenarios.
- "Unit test major test function point"
- Module interface testing, local data structure testing, path testing, error handling testing, and boundary condition testing.
- "Apache ab test user guide"
- "Large Website Stress Testing and Optimization Program"
- "10 mainstream pressure / load / performance test tool recommended"
- "True traffic pressure measurement tool tcpcopy application analysis"
- "nGrinder Easy-to-use tutorial"
- "Jingdong 618: Upgrade full-link pressure test program to create ForceBot for military exercises"
- "Hungry? Exploration and Practice of Full Link Pressure Measurement"
- "Four languages, eight frameworks | Drip drop full-link pressure measurement solution"
- "Full-Link Pressure Test Experience"
-
Technical Dry Goods | AB Testing and Grayscale Distribution Exploration and Practice
-
Blue Green Deployment, A/B Testing, and Grayscale Publishing
- "Several Diagrams Help You Understand Docker Fundamentals and Quick Start"
- Docker Core Technology and Implementation Principles
- Docker Tutorial
- Confluence - Charge Document Management System
- GitLab?
- Wiki
-
"Basic Learning of Ngnix - Comparison of Multiple Processes and Apache"
- Nginx achieves high concurrency through asynchronous non-blocking event handling mechanisms. Apache monopolizes one thread per request and consumes system resources.
- Event-driven is suitable for IO intensive services (Nginx), multi-process or thread-adapted to CPU-intensive services (Apache), so Nginx is suitable for reverse proxy, not web server use.
-
"Comparisons and advantages and disadvantages of nginx and Apache"
- Nginx is only suitable for static and reverse proxies and is not suitable for handling dynamic requests.
- Official website
- "On OpenResty"
- The Lua module can be developed on Nginx.
-
"Tomcat System Architecture and Design Patterns, Part 1: How It Works"
-
"JBoss vs. Tomcat: Choosing A Java Application Server"
- Tomcat is a lightweight Serverlet container that does not implement all JEE features (such as persistence and transaction processing) but can be replaced by other components such as Srping.
- Jboss implements all JEE features, free software open source, and documentation fees.
-
- Start NIO mode (or APR); adjust thread pool; disable AJP connector (Nginx+tomcat architecture, no AJP required);
-
AJP vs. HTTP Comparison and Analysis
- The AJP protocol (port 8009) is used to reduce the number of connections (front-end) to the front-end Server (such as Apache, which also needs to support the AJP protocol), and to increase performance through long connections.
- When concurrency is high, the AJP protocol is better than the HTTP protocol.
- "How Jetty Works and Comparison with Tomcat"
- "Compared advantages of jetty and tomcat"
- Architecture comparison: Jetty's architecture is much simpler than Tomcat's.
- Performance comparison: Jetty and Tomcat have little difference in performance. Jetty uses NIO to end up with more advantages in handling I/O requests. Tomcat uses BIO to handle I/O requests by default. Tomcat is suitable for handling a few very busy links and handles static resources. Poor performance.
- Other aspects: The application of Jetty is faster, simpler to modify, and better supported by the new Servlet specification; Tomcat supports JEE and Servlet more comprehensively.
-
- On-heap, off-heap, disk level 3 cache.
- Can be set according to the amount of cache space.
- According to time, number of times and other expiration strategies.
-
- Simple and lightweight, no heap, disk cache.
-
- Mainly using the Cache-Control parameter.
-
"In-depth understanding of the principle of Memcached"
- Use multiplexing techniques to increase concurrency.
- The slab allocation algorithm: memcached allocates memory space for Slab, the default is 1MB. After allocating to Slab, the slab of the slab is divided into chunks of the same size. Chunk is the memory space used to cache the records. The chunk size is incremented by 1.25 times by default. The advantage is that it will not frequently apply for memory and improve IO efficiency. The disadvantage is that there will be a certain amount of memory waste.
-
"Memcache Technology Sharing: Introduction, Usage, Storage, Algorithms, Optimization, Hit Rate"
-
Differences between add, set, and replace in memcache
- The difference is that when the key exists or does not exist, the return value is true and false.
-
"The principle of redis bottom"
- Using ziplists to store linked lists, ziplists are a kind of compressed list, which has the advantage of saving more memory because everything it stores is in a contiguous area of memory.
- Skiplist is used to store ordered collection objects, search on high level, complexity of time and red-black tree, implementation is easy, lock-free and concurrency is good.
-
- RDB mode: Periodically backs up snapshots and is commonly used for disaster recovery. Advantages: Backing up through the fork process does not affect the speed of the main process and RDB when recovering large data sets faster than AOF recovery. Disadvantages: Will lose data.
- AOF mode: Save the operation log mode. Advantages: Less data loss during recovery, disadvantages: large files, slow response.
- It can also be used in combination.
-
"Distributed Cache - Sequence 3 - Atomic Operations and CAS Optimistic Locking"
- Official website
- "The Comparison of Tair and Redis"
- Features: You can configure the number of backup nodes, asynchronously to the backup node
- Consistent hashing algorithm.
- Architecture: Similar to the design concept of Hadoop, Configserver, DataServer, and Configserver are used to detect heartbeats. Configserver also has a master/slave relationship.
Several storage engines:
- MDB, full memory, can be used to store data such as Session.
- Rdb (similar to Redis), lightweight, removes operations like aof, supports Restfull operations
- LDB (LevelDB storage engine), persistent storage, LDB as a persistence of rdb, google implementation, more efficient, theoretical basis is the LSM (Log-Structured-Merge Tree) algorithm, now modify the data in memory, reach a certain amount (and Memory aggregated old data is written to disk together. Write to disk and storage is more efficient. The county compares the hash algorithm.
- Tair uses shared memory to store data. If the service goes down (not the server), the data is still available after the service is restarted.
-
Message Queue - Push/Pull Mode Learning & ActiveMQ and JMS Learning
- The RabbitMQ consumer defaults to push mode (also supports pull mode).
- Kafka defaults to pull mode.
- Push mode: The advantage is that the message can be sent to the consumer as soon as possible. The disadvantage is that if the consumer's processing power cannot keep up, the consumer's buffer may overflow.
- Pull: The advantage is that the consumer can pull it off according to its processing power. The disadvantage is that it will increase the message delay.
The message bus is equivalent to a layer of encapsulation on the message queue, unified entrance, unified management and control, simplifying the access cost.
Supports transactions, push and pull modes are all supported, and are suitable for scenarios requiring reliable message transmission.
- "RabbitMQ Application Scenarios and Introduction to Basic Principles"
- Message Queue RabbitMQ
- "RabbitMQ message confirmation mechanism (transaction + Confirm)"
Java implementation, push and pull modes are all supported, and the throughput is lower than Kafka. The order of messages can be guaranteed.
Pure Java implementation, compatible with JMS, can be embedded in Java applications.
High throughput, pull mode. Suitable for high IO scenarios, such as log synchronization.
- Official website
- "Compared with the message queues, Kafka's in-depth analysis, everyone's recommendation, wonderful good! 》
- "Introduction and Example of Kafka Partitioning Mechanism"
Producer and consumer patterns are completely client-side behaviors, list and pull modes are implemented, blocking waits for blpop instructions.
TODO
-
"Linux cron operation principle"
- Fork process + sleep poll
-
"quartz principle secret and source code interpretation"
- Scheduled scheduling In the QuartzSchedulerThread code, while() loops indefinitely, every time the loop retrieves the trigger that the time will reach, and the corresponding job is fired until the scheduler thread is closed.
-
"These excellent domestic distributed task scheduling system, you used a few? 》
- Opencron, LTS, XXL-JOB, Elastic-Job, Uncode-Schedule, Antares
-
"The Basic Principles of Quartz Task Scheduling"
- Quartz cluster, independent Quartz node does not communicate with another node or management node, but through the same database table to another Quartz application
-
"Implementing the RPC Framework from scratch - Principles and realization of RPC"
- Core roles: Server: The service provider exposing the service, Client: The service consumer calling the remote service, Registry: The registration center for service registration and discovery.
** SPI ** TODO
- Official website
- "Thrift RPC Explained"
- Supports multiple languages, defining interfaces through intermediate languages.
The server can be authenticated and encrypted. In an external network environment, data security can be guaranteed.
- "Build an ELKB Log Collection System from scratch"
- "Establish a Simple Log Collection and Analysis System with ELK"
- "Log Collection System - Inquiry"
-
Apollo - Ctrip's Configuration Center Application
- Spring Boot and Spring Cloud
- Support push and pull mode update configuration
- Supports multiple languages
-
"Using zookeeper to achieve unified configuration management"
-
Spring Cloud Config Distributed Configuration Center Tutorial
Servlet 3.0 Asynchronous Feature Available to Configuration Center Clients
Main responsibilities: request forwarding, security authentication, protocol conversion, disaster recovery.
-
"About the background, architecture and landing plan of API gateway"
-
"Kong Introduction to One of the HTTP API Gateway Selections"
- "Detailed Analysis of HTTP 2.0 Principles"
- "The basic unit of HTTP2.0 is binary frame"
- Use binary frames for transmission.
- Multiplexing.
-
"https Principles of Popular Understanding"
- Using asymmetric encryption to negotiate encryption algorithms
- Use symmetric encryption to transfer data
- Use a certificate issued by a third party to encrypt the public key for secure transmission of the public key and prevent it from being altered by an intermediary.
-
Eight Free SSL Certificates - Adding Https Security to Your Website for Free
-
- Five I/O models: Blocking I/O, Non-blocking I/O, I/O Multiplexing, Event (Signal) Driven I/O, Asynchronous I/O, and the first four I/Os are synchronous operations, I/O The first stage of O is the same and the second stage is the same. The last one belongs to asynchronous operation.
- Three kinds of Web Server work methods: Prefork (multi-process), Worker mode (thread mode), Event mode.
-
Summary of differences between select, poll, and epoll
- Select, poll, and epoll are essentially synchronous I/O because they all need to be responsible for reading and writing after the read/write event is ready. This means that the read/write process is blocked.
- Select has a limit on the number of open file descriptors, the default is 1024 (2048 for x64), 1 million concurrent, 1000 processes will be used, and the switching overhead is large; poll uses the linked list structure, and there is no limit to the number.
- Select, poll "wake up" when iterating over the entire fd collection, and epoll "wake up" as long as the judgment is ready list is empty, through the callback mechanism to save a lot of CPU time; select, poll call every time To copy the fd set from the user state to the kernel state, epoll only needs to copy once.
- With the increase of concurrent poll, the performance gradually declines. Epoll adopts the red-black tree structure and has stable performance. It will not decrease as the number of connections increases.
-
"select, poll, epoll comparison"
- In situations where the number of connections is small and the connections are very active, the performance of select and poll may be better than epoll. After all, the epoll notification mechanism requires a lot of function callbacks.
-
"In-depth understanding of Java NIO"
- NIO is a synchronous non-blocking IO model. Synchronization means that the thread continuously polls for IO events. Non-blocking means that the thread can wait for IO and can do other tasks at the same time.
-
"Two Efficient Server Design Models: Reactor and Proactor Models"
- "Netty principle analysis"
- Reactor mode introduction.
- Netty is an implementation of Reactor mode.
- Understanding of Zero Copy for Netty ByteBuf
- Multiple physically separate buffers are logically merged into one, thus avoiding data copying between memory.
- "Hessian Principle Analysis" Binary-RPC; not just serialization
-
"Java application example of Protobuf protocol" Goolge produced, occupied space and efficiency outperformed other serialization libraries such as Hessian; need to write .proto file.
-
"Protocol Buffers Serialization Protocol and Application"
- Explain about the agreement; Disadvantages: poor readability;
-
"Simple use of protobuf and protostuff"
- The advantage of protostuff is that instead of writing .proto files, Java objects can be serialized directly.
- "Three Paradigms of Database and Five Constraints"
- The first normal form: each column (each field) in the data table must be the smallest unit that cannot be split, that is, to ensure the atomicity of each column;
- Second Normal Form (2NF): After satisfying 1NF, all the columns in the table must be dependent on the primary key. No column can be related to the primary key. That is, a table describes only one thing.
- The third paradigm: must meet the second paradigm (2NF), requirements: each column in the table is only directly related to the primary key and not indirectly, (each column in the table can only rely on the primary key);
-
"MySQL Storage Engine - Difference between MyISAM and InnoDB"
- The main difference between the two types is that Innodb supports transaction processing and foreign key and row-level locking
-
"The difference between myisam and innodb index implementation"
-
"MYSQL paging limit speed is too slow optimization method"
- In principle, it is to narrow the scanning range.
MyISAM is non-clustered, InnoDB is aggregated
- MongoDB Tutorial
- "The Advantages and Disadvantages of Mongodb vs. Relational Databases"
- Advantages: weak consistency (eventually consistent), better guarantee user access speed; built-in GridFS, support for large-capacity storage; Schema-less database, no pre-defined structure; built-in Sharding; compared to other NoSQL, third-party support is rich Superior performance;
- Disadvantages: mongodb does not support transaction operations; mongodb takes up too much space; MongoDB does not have mature maintenance tools such as MySQL, which is a noteworthy area for development and IT operations;
-
"The difference between traditional row storage and (HBase) column storage"
-
"The difference between Hbase and traditional database"
- Empty data is not stored, saving space and is suitable for concurrency.
-
- Rowkey is arranged in lexicographic order for batch scanning.
- Hot spots can be avoided by hashing.
-
"15-day performance optimization work, 5 aspects of tuning experience"
- Code level, business level, database level, server level, front-end optimization.
- "Methodology and Typical Cases for Network Performance and Capacity Assessment"
- "Internet architecture, how to design capacity? 》
- Assess total visits, evaluate average visits QPS, evaluate peak QPS, evaluate systems, stand-alone limit QPS
E.g:
- Advertising related real-time statistics;
- Recommended system user image tag updates in real time;
- Online service health monitoring in real time;
- Real-time rankings;
- Real-time statistics.
- "What is Hadoop, what can I do in easy-to-understand words?"
- "The most detailed Hadoop environment in history"
- "Evil JAVA HASH DOS Attack"
- Using JsonObjet to upload large Json, JsonObject uses HashMap at the bottom; different data produces the same hash value, making the build Hash slower and running out of CPU.
- An Advanced DoS Attack - Hash Collision Attack
- "About Hash Collision DoS: Parsing and Solution"
-
"Detailed Explanation of the Implementation Principle of Slip Authentication Code"
- The sliding verification code evaluates the risk based on the response time, drag speed, time, position, trajectory, number of retries, etc. of the user in the sliding slider.
- User password is not stored in plain text, plus dynamic slat.
- ID number, mobile number If you want to display, replace some of the characters with "*".
- The display of the contact information is controlled by the user himself or herself.
- TODO
- "Lib's past? Java Universal Deserialization Vulnerability Analysis
- Common symmetric encryption algorithm
- DES, 3DES, Blowfish, AES
- DES uses a 56-bit key and Blowfish uses 1- to 448-bit variable keys, AES 128, 192, and 256-bit length keys.
- The DES key is too short (56-bit only) algorithm is currently replaced by AES, and AES has hardware acceleration and performs well.
-
- MD5 and SHA-1 are no longer secure and have been deprecated.
- Currently SHA-256 is relatively safe.
-
Public Internet URL Signature Verification Design Scheme Based on Hash Digest Signature
- Common Asymmetric Encryption Algorithm
-
RSA, DSA, ECDSA (Helix Curve Encryption Algorithm)
-
Unlike RSA, DSA can only be used for digital signatures and cannot encrypt or decrypt data. Its security is comparable to that of RSA, but its performance is faster than that of RSA.
-
The 256-bit ECC key has the same security as the 3072-bit RSA key.
-
TODO
TODO
In the internal and external environment, log in to the online host through the springboard.
- "Permission Design Based on Role of Organization"
- "Permission System and RBAC Model Overview"
- "Spring integrates Shiro to do a detailed case analysis of permission control module"
2FA - Two-factor authentication for enhanced login authentication
Common practice is login password + phone verification code (or token key, similar to the USB key with online banking)
- ["Two-Factor Authentication (2FA) Tutorial"] ( http://www.ruanyifeng.com/blog/2017/11/2fa-tutorial.html )
- "log4j explain in detail"
- "log4j2 practical use Detailed Explanation"
- "Log4j1, Logback and Log4j2 performance test comparison"
- Log4J asynchronous log performance is excellent.
- ORM Framework Uses Advantages and Disadvantages
- The main purpose is to improve the development efficiency.
MyBatis:
-
"Mybatis caching mechanism explain"
- The first level cache is the SqlSession level cache, the cached data only valid in the SqlSession
- The second-level cache is the mapper-level cache, which is shared by the same namespace, so the SqlSession is shared; the cache is cleared using the LRU mechanism, and is enabled by the cacheEnabled parameter.
TODO
Spring
Spring Boot
Spring Cloud
-
Ten Top Ten Scalable Architectures that Architects Must Know
- In summary, the common routine is distribution, caching, and asynchronous processing.
-
"Scalability Design Data Segmentation"
- Horizontal splitting + vertical splitting
- Use middleware for sharding such as MySQL Proxy.
- Segmentation is performed using a sharding strategy, such as modulo the ID.
-
"Talk about how to implement scalable large-scale website architecture"
- Distributed Services + Message Queuing.
-
"Large Web Site Technology Architecture (7)--Website Extensibility Framework"
-
"System Design: Some Technical Solutions for High Availability Systems"
- Scalable: horizontal expansion, vertical expansion. Through redundant deployment, single points of failure are avoided.
- Isolation: Avoiding a single business occupies all resources. Avoid business interactions 2. Computer room isolation avoids single points of failure.
- Decoupling: Reduce maintenance costs and reduce coupling risks. Reduce dependence and reduce mutual influence.
- Current limiting: sliding window counting, leaky bucket algorithm, token bucket algorithm and other algorithms. When encountering burst traffic, ensure the system is stable.
- Degradation: The release of non-core functional resources in an emergency. Sacrifice non-core business to ensure high availability of core business.
- Fuse: An abnormal condition exceeds the threshold and enters the blown state and quickly fails. Reduce the impact of unstable external dependencies on core services.
- Automated testing: Reduce faults caused by publications through comprehensive testing.
- Grayscale publishing: Grayscale publishing is a compromise between speed and security that can effectively reduce release failures.
-
"About Highly Available Systems"
- Design principles: data is not lost (persistent); service is highly available (copy of service); absolute 100% high availability is difficult, the goal is to do as much as 9, such as 99.999% (accrued for only 5 minutes throughout the year).
-
"turn! ! Comparison of the advantages and disadvantages of the load balancer technology Nginx and F5
- Mainly compared with F5.
-
How much do you know about software/hardware load balancing products? 》
-
"Several load balancing algorithms" round robin, weight, load, least connection, QoS
-
- The configuration is simple and the update speed is slow.
-
- Simple and lightweight, low learning cost; mainly suitable for web applications.
-
"Load balancing with LVS+Keepalived"
- The configuration comparison load only supports up to four layers and the performance is high.
-
"HAProxy usage details of the entire network of the most detailed Chinese document"
- Support to seven layers (such as HTTP), more comprehensive features, performance is not bad.
-
"Haproxy + Keepalived + MySQL to achieve read-balance load"
- Mainly load balancing of user read requests.
-
"rabbitmq+haproxy+keepalived achieve high availability cluster construction"
- "Talk about the Current Limitations of High Concurrent Systems"
- Counter: Sliding the window counter to control the number of requests per unit time, simple and crude.
- Leaky bucket algorithm: Fixed-capacity leaky buckets, which are frequently used when the leaky bucket is full.
- Token bucket algorithm: a fixed-capacity token bucket. To add a token at a certain rate, the token needs to be obtained before the request is processed. If the token is not available, the request is discarded or the queue is dropped. The rate of adding the token can be controlled. To control the overall speed. The RateLimiter in Guava is an implementation of a token bucket.
- Nginx limiting: By
limit_req
limiting the number of concurrent connections module.
-
"Avalanche Fighters: Principles and Uses of Fused Hystrix"
- Avalanche effect causes: hardware failures, hardware failures, program bugs, retries to increase traffic, and user requests.
- Avalanche countermeasures: current limit, improved cache mode (cache preload, synchronous call change asynchronous), automatic expansion, and degraded.
- Hystrix Design Principles:
- Resource isolation: Hystrix avoids service avalanche by isolating each dependent service by assigning separate thread pools for resource isolation.
- Fuse switch: health status of service = request failures / total number of requests, threshold setting and sliding window control switch.
- Command mode: wraps the service invocation logic by inheriting the HystrixCommand.
-
Cache Penetration, Cache Breakdown, Cache Avalanche Solution Analysis
-
"Cache Breakdown, Failure, and Hot Key Problems"
- The main strategy: failure instant: stand-alone use of locks; use of distributed lock; not expire;
- Hotspot data: Hotspot data is stored separately; use local cache; divided into multiple subkeys;
-
"Distribution Experience of Multi-Room and Multi-Rooms"
- Synchronous data synchronization through self-developed middleware.
-
"Disposal of living in different places (remote living) experience"
- Pay attention to the delay problem. Multiple calls across the room will amplify the delay several times.
- There is a large probability that there will be a large number of building room lines, and fault tolerance will be done at the operation and maintenance level and at the program level.
- Can not rely on dual-write data in the program, there must be automatic synchronization program.
- The data never considers high delays or poor network quality, considering synchronization quality issues.
- The core business and the secondary business are divided and conquered, and even only the core business is considered.
- Remote live monitoring deployment and testing should also keep up.
- Consider user partitions where business is allowed, especially games and email services.
- Control the size of the message body across the room, the smaller the better.
- Consider using docker container virtualization technology to improve dynamic scheduling capabilities.
- "Reliance Governance, Grayscale Distribution, Fault Exercises, Design and Practical Experience of Alibaba.com's Fault Exercise System"
- Common fault portrait
- Case: Preplan validity, plan validity, fault replication, architecture disaster recovery testing, parameter tuning, parameter tuning, fault raid, and joint drill.
-
Smooth restart application ideas 1. End-point traffic (such as vip layer), 2. Flush data (if any), 3, restart the application
-
"The JVM security exit (how to gracefully shut down the java service)" Recommended to introduce: System.exit, Kill SIGTERM; not recommended kill-9; use Runtime.addShutdownHook registration hook.
-
"How Common Java Applications Are Gracefully Closed" Java, Srping, Dubbo gracefully closes.
-
DRBD+Heartbeat+Mysql High Availability Read/Write Detach Architecture
- DRDB performs disk copying to avoid single points of problems.
-
"Sub-tables need to consider the issues and programs"
- Middleware: Lightweight: sharding-jdbc, TSharding; Heavyweight: Atlas, MyCAT, Vitess, etc.
- Problem: transaction, Join, migration, expansion, ID, paging, etc.
- Transaction compensation: reconciliation of data; comparison based on logs; regular synchronization with standard data sources.
- Sub-library strategy: numerical range; modulus; date, etc.
- The number of sub-libraries: usually MySQL single library 50 million, Oracle single library 100 million need to sub-library.
-
"MySql Table and Table Partition Detailed"
- Partitioning: It is an internal mechanism of MySQL. It is transparent to the client. Data is stored in different files. On the surface, it is the same table.
- Table: Physically create different tables, clients need to manage the sub-table routing.
-
"Never lose contact! How to achieve service discovery in microservice architecture? 》
- Client service discovery mode: The client directly queries the registry and is responsible for load balancing. Eureka uses this approach.
- Server-side service discovery mode: The client queries service instances through load balancing.
-
"SpringCloud Service Registry Comparison: Consul vs Zookeeper vs Etcd vs Eureka"
- CAP support: Consul (CA), zookeeper (cp), etcd (cp), Euerka (ap)
- The author thinks Consul's support for Spring cloud is better.
-
"Zookeeper based service registration and discovery"
- Advantages: API is simple, Pinterest, Airbnb in use, multi-language, through the watcher mechanism to achieve configuration PUSH, can quickly respond to configuration changes.
- Distributed Services Framework Study Notes 4 Service Routing
- Principle: Transparent routing
- Load Balancing Policy: Random, Polling, Service Call Latency, Consistent Hash, Sticky Connection
- Local routing has a limited strategy: injvm (preferentially calling jvm internal services) and initial (priority using the same physical machine services), and in principle finding the nearest service.
- Configuration method: unified registry, local configuration, and dynamic delivery.
- "Discussing CAP Theory, BASE Theory from Distributed Consistency"
- Consistency classification: strong agreement (immediately consistent); weakly consistent (achievable in units of time, such as seconds); eventually consistent (weakly consistent, eventually consistent within a certain period of time)
- CAP: Consistency, Availability, Partition Fault Tolerance (Cause of Network Failure)
- BASE: Basically Available, Soft state, and Eventually consistent
- The core idea of BASE theory is: Even if it can not achieve strong consistency, but each application can be based on their own business characteristics, using appropriate methods to achieve the final consistency of the system.
-
"Several Implementations of Distributed Locks"
- Database-based distributed locks: Advantages: Simple and easy to understand. Disadvantages: There is a single point problem, the database can be a large overhead, not reentrant;
- Cache-based distributed locks: Advantages: Non-blocking, good performance. Disadvantages: Operation is not easy to cause the lock can not be released.
- Zookeeper distributed lock: The lock mechanism is implemented by an orderly temporary node, and its corresponding node needs to be the smallest, and it is considered that the lock is obtained. Advantages: The cluster can solve single problems transparently, avoiding locks from being released, and locks can be reentrant. Disadvantages: Performance is not as good as caching, and throughput decreases as the zk cluster grows in size.
-
"Zookeeper Based Distributed Lock"
- Clear principle description + Java code example.
-
"jedisLock-redis distributed lock implementation"
- Based on setnx(set if ont exists), it returns false, otherwise it returns true. And support expired time.
-
Memcached and Redis Distributed Locking Scheme
- Use the add (as opposed to set) operation of memcached to return false when the key exists.
- "Distributed Series Articles - Principles and Derivation of Paxos Algorithm"
- Paxos-->Fast Paxos-->Zookeeper Analysis
- "Distributed" Zookeeper and Paxos
- Why is Raft More Easier to Understand Distributed Consistency Algorithms?
- Three roles: Leader, Follower, Candidate
- The ballot was sent out by way of random waiting, winning more votes.
- "Distributed Systems - Idempotency Design"
- The role of idempotency: The resource is idempotent and the requester doesn't need to worry about repeated calls that can generate errors.
- Common means to guarantee idempotency: MVCC (similar to optimistic locking), deduplication table (unique index), pessimistic locking, one-time token, serial number mode.
- Distributed System Transactional Conformance Solution
- "Six Plans to Guarantee the Consistency of Distributed System Data"
- "Traditional and Flexible Affairs"
- Based on BASE theory: basic availability, flexibility, and eventual consistency.
- Solution: Record log + compensation (forward supplement or rollback), message retry (requires the program to be exponentiated, etc.); "no lock design", using optimistic locking mechanism.
- Talk about distributed file storage system - basic architecture ?
- "Compare the distributed file system" ?
- HDFS: Read and write large amounts of data for high-throughput scenarios, not for small files.
- FastDFS: lightweight, suitable for small files.
-
Generating Globally Unique Id Summary in Highly Concurrent Distributed Systems
- Twitter scheme (Snowflake algorithm): 41-bit timestamp + 10-digit machine identifier (such as IP, server name, etc.) + 12-digit serial number (local counter)
- Flicker project: MySQL self-increment ID + "REPLACE INTO XXX:SELECT LAST_INSERT_ID();"
- UUID: Disadvantages, unordered, too long strings, take up space, affect retrieval performance.
- MongoDB Scenario: Use ObjectId. Disadvantages: can not increase.
-
The TDDL SEQUENCE Principle Under Distributed
- Create a sequence table in the database to record the maximum value of the id that is currently occupied.
- Each client host takes an id interval (such as 1000~2000) cached locally, and updates the id maximum record in the sequence table.
- Different id ranges are used between client hosts. After they are used up and fetched, optimistic locking is used to control concurrency.
-
"Talking about my understanding of DDD-driven design"
- Concept: DDD is mainly proposed for the separation of the various stages of the traditional software development process (Analysis-Design-Code) to avoid undeliverable software (and requirements) due to unclear analysis at first or inconsistent information flow during software development. Assuming inconsistencies). DDD emphasizes that everything is centered on the domain and emphasizes the role of Domain Expert. It emphasizes that the domain model is first defined and then developed, and the domain model can guide the development (the so-called driver).
- Process: Understanding the domain, splitting the domain, refining the domain, the accuracy of the model depends on the depth of understanding of the model.
- Design: DDD proposes modeling tools such as aggregations, entities, value objects, factories, warehousing, domain services, and domain events to help with domain modeling.
-
"Summary of Domain Driven Design Basics"
- Domain (Doamin) is essentially a problem domain, such as an e-commerce system, a forum system, etc.
- Bounded Context: Explains the relationship between subdomains and can be simply understood as a subsystem or component module.
- Domain Model: The core of DDD is to establish the correct domain model (using universal description language, tools, and domain common language); to reflect the nature of business requirements, including entities and processes; it runs through software analysis, design, and development. Process; commonly used expression field model: diagram, code or text;
- Domain common language: Domain experts, developers and designers can have immediate language or tools.
- The classic layered architecture: user interface/presentation layer, application layer, domain layer, and infrastructure layer is a four-tier architecture model.
- The mode used:
- Link as little as possible, as far as possible single item, try to reduce the overall complexity.
- Entity: The only indication in the domain that an entity has as few attributes as possible and at least as clear.
- Value Object: There is no unique identifier, and the property value is immutable. The second is a simple object, such as Date.
- Domain Service: Coordinate multiple domain objects, only the method has no state (no data); it can be divided into application layer services, domain layer services, and basic layer services.
- Aggregate, Aggregate Root: Aggregate defines a set of related objects with a cohesive relationship; the aggregate root is the only element of the aggregate reference; when modifying an aggregate, it must be at the transaction level; most areas In the model, 70% of aggregates usually have only one entity, and 30% only have 2 to 3 entities; if an aggregate has only one entity, then this entity is the aggregate root; if there are multiple entities, then we can think about which object in the aggregate Has independent significance and can interact with the outside directly;
- Factory: Similar to the factory mode in design mode.
- Repository: Persisting to DB, managing objects, and designing storage only for aggregates.
-
"Realm Driven Design (DDD) Road to Realization"
- Aggregation: For example, a Car contains components such as Engine, Wheel, and Tank.
-
"Field-Driven Design Series (2) Analysis of VO, DTO, DO, PO Concepts, Differences, and Uses"
CQRS - Command Query Responsibility Seperation
-
"Field Driven Design Series (6): CQRS"
- The core idea: read and write separation (inquiry and update in different methods), different processes are only different design methods, CQ code separation, there will be obvious manifestation in the distributed environment (in the case of redundant data), the purpose is For high performance.
-
"Comparison of advantages and disadvantages of DDD CQRS architecture and traditional architecture"
- Ultimately consistent design concept; depends on highly available message middleware.
-
"Introduction to CQRS Architecture"
- An abstract case of implementing CQRS.
-
Depths: My Thoughts on CQRS/EventSourcing Architecture
- CQRS Pattern Analysis + 12306 Ticket Picking Cases
- "Anemia, explanation of hyperemia model, and some experience"
- Blood loss model: Lao Tzu and son are defined separately, and they do not know each other. There is no business logic in the entity definition of the two, and they are related through external services.
- Anemia model: Laozi knows son, son also knows Laozi; part of the business logic is put into the entity; Advantages: Individual layers of dependent, structural clear, easy to maintain; Disadvantages: does not meet the OO thinking, compared to the congestion model, the service layer is more heavy ;
- Congestion model: Similar to the anemia model, the difference lies in how to divide the business logic. Advantages: The service layer is relatively thin, only acts as a facade, does not deal with DAO, compound OO thinking; disadvantages: non-single dependency, bi-directional dependency between DO and DAO, and logical division of the Service layer is likely to cause confusion.
- Swollen mode: It is an extreme situation, cancel the service layer, all the business logic in DO; Advantages: in line with OO ideas, simplification of layering; Disadvantages: too much exposure information, many non-DO logic will be forced into DO. This pattern should be avoided.
- The authors advocate using the anemia model.
TODO
TODO
TODO
TODO
TODO
TODO
- "How architecture design reviews architecture design specifications"
- "Everyone is an architect: Non-functional requirements"
TODO
Institution or system! In addition, each company needs to develop its own check list based on its own needs and goals.
-
"Why did you do bad Code Review? 》
- The code review does well in institutional building.
SCRUM - Scrimmage
-
Three roles: Product Owner (PO) Product Owner; Scrum Master (SM) to promote Scrum execution; Team development team.
-
3 artifacts: Product Backlog product TODOLIST, with priority; Sprint Backlog function development TODO LIST; burn down diagram;
-
Five Values: Focus, Courage, Openness, Commitment, Respect.
-
"Agile project management process - Scrum framework is the most complete! 》
TODO
XP - eXtreme Programming
- "Mainstream Agile Development Method: Extreme Programming XP"
-
It is a methodology to guide developers.
-
4 great values:
- Communication: Encourage verbal communication and increase efficiency.
- Simple: Just enough.
- Feedback: timely feedback, notify relevant people.
- Courage: Advocate embrace change, dare to reconstruct.
-
Five principles: fast feedback, simple assumptions, gradual modification, promotion of change (small step run), high quality work (guarantee the quality of the premise to guarantee small steps run).
-
5 jobs: Staged sprints; sprint planning meetings; daily standing meetings; sprint review;
-
Write code, edge review. Can enhance code quality and reduce bugs.
TODO
TODO
TODO
TODO
Article 253 of the Chinese Criminal Law states:
- Staff of state agencies or units in finance, telecommunications, transportation, education, medical care, etc., who, in violation of state regulations, sell or illegally provide personal information of citizens obtained by the entity in the course of performing its duties or providing services to others, if the circumstances are serious, Departments shall be sentenced to fixed-term imprisonment of not more than 3 years or criminal detention and shall be concurrently executed or a single fine.
- If the above information is stolen or otherwise illegally obtained, and the circumstances are serious, it shall be punished in accordance with the provisions of the preceding paragraph.
- If a unit guilty of the first two crimes, the unit shall be fined, and the person directly in charge and other persons directly responsible shall be punished in accordance with the provisions of each paragraph.
The Supreme People's Court and the Supreme People's Procuratorate's Supplementary Provisions (IV) on the enforcement of the "Criminal Law of the People's Republic of China" confirming that the offender violates paragraph 1 of Article 253 of the Criminal Law and constitutes the crime of "selling and illegally providing personal information of citizens"; Infringe the provisions of paragraph 2 of Article 253 of the Criminal Law and constitute the crime of “illegal acquisition of personal information of citizens”
-
- Business understanding and abstraction capabilities
- NB's code capabilities
- Comprehensiveness: 1. Will there be multiple technical solutions in the minds of architects in the face of business problems; 2. Do you consider enough aspects in the design of the system? 3. Do you consider enough in system design? Many aspects;
- Global: Whether to consider the impact on the upstream and downstream systems.
- Tradeoffs: trade-offs between input-output ratios; priority and rhythm control;
-
What Things Architects Must Know About Architecture Optimization and Design
- The details to consider: Modular, light-coupled, shared-nothing architecture; reduction of dependencies before individual components, attention to dependencies between services, and all the resulting chain failures and effects.
- Comprehensive consideration of infrastructure, configuration, testing, development, operation and maintenance.
- Consider the influence of people, teams, and organizations.
-
"How can I really improve myself and become an outstanding architect? 》
-
"Architect's Essential Quality and Growth Path"
- Quality: business understanding, breadth of technology, depth of technology, rich experience, communication skills, hands-on capabilities, and aesthetic qualities.
- Growth path: 2 years of accumulated knowledge, 4 years of accumulated skills and influence within the group, 7 years of accumulated influence within the sector, and 7 years of accumulated cross-sectoral influence.
-
"Architects - Where are you on the floor? 》
- The first-tier architect sees only the product itself
- The second-tier architect not only saw his own product but also saw the overall solution
- Third-tier architects see business value
TODO
TODO
- Shan Yifeng's Weblog
- Cool Shell - COOLSHELL-Chen Hao
- Hellojava - Ali Bixuan
- Cm's Blog
- Program 猿 DD - Yongchao Chao - Author of Spring Cloud Microservices Act
domestic:
-
CSDN veteran technology community, do not have to explain.
-
- Partial Java direction
-
- Partial Linux direction
-
- Covers IT workplace, Web front end, back end, mobile end, database and other aspects, partial technology.
foreign:
- Segmentfault
- Q&A + Column
- Know almost
- Stackoverflow
-
test:
-
Operation and maintenance:
-
Java:
- ImportNew
- Focus on Java technology sharing
- HowToDoInJava
- English blog
- ImportNew
-
Safety
-
Big Data
-
Other special websites:
- DockerInfo
- Website focused on Docker applications and consulting, tutorials.
- Linux Commune
- Linux Theme Community
- DockerInfo
- "Software Architect's 12 Practices: Technical Skills" Jingdong Taobao
- "The Beauty of Architecture" Jingdong Taobao
- "Distributed Service Architecture" Jingdong Taobao
- "Talking Architecture" Jingdong Taobao
- "Cloud native application architecture practice" Jingdong Taobao
- "100 million-level traffic site architecture core technology" Jingdong Taobao
- "This decade of Taobao technology" Jingdong Taobao
- "Transformation of Enterprise IT Architecture - Strategic Thinking of China-Taiwan Strategy and Architecture Combat" Jingdong Taobao
- "CTO said" Jingdong Taobao
- "Technology Management" Jingdong Taobao
- "Netease Arabian Nights: The Reality of Internet Product Project Management" Jingdong Taobao
TODO
domestic:
-
- HTML, CSS, XML, Java, Python, PHP, design patterns, and other introductory manuals.
-
- Many, many Chinese online e-books are a new open source technology document sharing platform.
-
- Paid e-books.
-
- AI, big data series Chinese documents.
foreign:
- Quick Code
- Free online technical tutorials.
- Gitbook.com
- There are some Chinese e-books.
- Cheatography
- Cheat Sheets, a one-page document website.
- Tutorialspoint
- Well-known tutorial website, providing high-quality introductory tutorials such as Java, Python, JS, SQL, big data.
- Apprentice worry-free
- Geek time
- Segmentfault
- Stark College
- Niu Ke Network
- Geek College
- 51CTO College
Event publishing platform:
- Geek Search
- Technical article search engine.
- Seven cattle
- Shooting clouds again
- Ali Cloud
- Tencent Cloud
- Baidu cloud
- Sina Cloud
- Jinshan Yun
- Amazon Cloud (AWS)
- Google Cloud
- Microsoft Cloud