Website statistics - design ideas (number of visitors, number of views, average visit time, average number of people online at the same time, maximum number of people online at the same time)

preface The website has been done well, and the leaders asked for several indicators. They have been looking for them online for a long time. Two ideas: 1. Baidu, Tencent, etc. provide statistical product interface, which can be used directly and is very convenient. But the way to use it is to put the data on their server and let them analyz ...

Posted by tomdelonge on Mon, 04 Apr 2022 02:24:44 +0300

Redis distributed lock and redis cluster construction

1, Thread lock and distributed lock Thread lock item Monomer project step The code is as follows //Define static global locks private readonly static object _lock = new object(); // Add code to controller lock (_lock) { Stock sto = new Stock(); sto = demoDbContext.stock.Where(p => p.ID == 1).FirstOrDefault ...

Posted by kkeim on Sat, 02 Apr 2022 17:44:06 +0300

Redis implements distributed locks (stand-alone version)

I Distributed lock What is distributed lock?   to introduce distributed lock, we should first mention that thread lock and process lock correspond to distributed lock. Thread Lock: mainly used to Lock methods and code blocks. When a method or code uses a Lock, only one thread executes the method or code segment at the same time. Thread L ...

Posted by satheshf12000 on Fri, 01 Apr 2022 09:18:59 +0300

PG daemon - the first-class citizen process in the background is kept alive

pmdie/reaper/sigusr1_handler -> PostmasterStateMachine --> StartupDataBase ServerLoop(postmaster.c)/reaper/sigusr1_handler --> StartBackgroundWriter ServerLoop(postmaster.c)/reaper/PostmasterStateMachine/sigusr1_handler --> StartCheckpointer ServerLoop(postmaster.c)/reaper --> StartWalWriter ServerLoop(postmaster.c)/sigusr1_handl ...

Posted by judgy on Thu, 31 Mar 2022 18:43:32 +0300

Map + functional interface method to solve if else

Click to follow 👉   2022-01-25 10:33 659 source codes included in topic # taro Click "taro source code" above and select“ Set as star" Whether she's ahead or behind? A wave that can wave is a good wave! Update the article at 10:33 every day and lose 100 million hair every day Source code boutique column Origi ...

Posted by cgm225 on Thu, 31 Mar 2022 10:54:41 +0300

Using Redis in Spring

Using Redis in Spring 1. Configuration environment <!-- https://mvnrepository.com/artifact/redis.clients/jedis --> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springf ...

Posted by xxreenaxx1 on Thu, 31 Mar 2022 09:43:00 +0300

What is OAuth2, the implementation of wechat login front and back, and Coding online

OAuth2 1, What problem does OAuth2 solve 1. Background of OAuth2 If the photo owner wants to print photos on the cloud printing service, the cloud printing service needs to access the resources on the cloud storage service 2. Legend Resource owner: Photo owner Customer application: cloud printing Protected resources: Photos 3. Method 1: ...

Posted by MytHunter on Thu, 31 Mar 2022 03:54:10 +0300

zset principle in Redis and implementation of jump table in Java

preparation First in Redis official website Download the latest stable version 6.2. Install on the Linux server according to the installation guide given on the official website. zadd calling procedure redis/src/server.c file defines the methods to be called by all commands. The zadd command calls t_zset.c file. struct redisCommand redisCom ...

Posted by Hillu on Wed, 30 Mar 2022 23:11:14 +0300

The function of nearby stores is realized in JAVA version

preface Recently, the company's project needs to realize the function of nearby stores. It is found that many methods can be realized by querying data. Including Mysql,Redis,Mongodb,PostgreSQL, etc redis and mongodb are selected for implementation. 1, Function of nearby stores redis implementation redis4. Version 0.14 uses the geo com ...

Posted by todd2006 on Wed, 30 Mar 2022 00:37:29 +0300

synchronized is no longer bloated. Put down the lightweight lock of his initial knowledge

preface Natural selection, survival of the fittest. JDK is also in constant optimization. As for the internal optimization of synchronized locks in JDK, we analyzed that biased locks are used to solve initial problems. With the continuous accumulation of competition, lightweight locks are produced.Pay attention to me, a progressive social anim ...

Posted by animedls on Mon, 28 Mar 2022 04:39:25 +0300