Jiajun的编程随想

Why split the complex join-table operation into multiple single-table queries?

“Why do you need to split complex join-table operations into multiple single-table queries?” 》When we are optimizing the system, a common operation is to dismantle the complex join-table operation into multiple single-table operations, and then perform the join in the application. Why do you want to do this? I believe everyone can list a few […]

Why split the complex join-table operation into multiple single-table queries? Read More »

Red envelope system design

“Design of the Red Envelope System” In the seckill system, a very common one is to grab red envelopes, and there are other such as: Double 11 snap-up, live broadcast instant kill orders, one yuan to win treasures, etc. Among them, the feature of grabbing red envelopes is that they cannot be oversold. For placing

Red envelope system design Read More »

2022 Year-End Summary

“2022 Year-End Summary” 2022 is a busy year, but also a year full of harvest. There are fewer blogs this year than in previous years. One is that I am too busy and have no time, and the other is that articles that are too watery do not have much meaning. It will be the

2022 Year-End Summary Read More »

A brief tutorial on Go mods

“Go mod Concise Tutorial” recently studied `go mod` carefully and compiled it into a document. This article is a systematic understanding of `go mod`, not a brief introduction to how to use it. Before `go mod` came out, the community adopted a model similar to `NodeJS`, `vendor`, that is, all packages are stored in the

A brief tutorial on Go mods Read More »

Golang gRPC error handling

“Golang gRPC Error Handling” The most common error handling method of gRPC is to return errors directly, such as `return nil, err`, but in actual business, we still have business codes to return, the common way is to define in the returned structure An error code, but it’s cumbersome to write this way, for example,

Golang gRPC error handling Read More »

Write maintainable unit test code

The article “Writing maintainable unit test code” mainly talks about the maintainability of unit test code. Don’t know if you’ve ever written spaghetti unit tests, that’s the structure. Frankly, I have written quite a few: “`go… This article is reproduced from https://jiajunhuang.com/articles/2022_10_31-goconvey.md.html This site is for inclusion only, and the copyright belongs to the original

Write maintainable unit test code Read More »

OAuth 2 Detailed Explanation (6): Authorization Code Flow with PKCE

“OAuth 2 Detailed Explanation (6): Authorization Code Flow with PKCE” We learned earlier that the `Authorization Code` mode is the safest mode, but the server must be involved, because the `client_secret` must be stored in the service End is safe. OAuth 2.0 defines an extension mode in [RFC7636](https://ift.tt/aV63EmA), in this mode, the client does not

OAuth 2 Detailed Explanation (6): Authorization Code Flow with PKCE Read More »

OAuth 2 Detailed Explanation (1): Introduction and Authorization Code Mode

“OAuth 2 Detailed Explanation (1): Introduction and Authorization Code Mode” In this series, we mainly explain the four authorization modes defined in [RFC6749](https://ift.tt/T8QbIBF), and [RFC7636](https PKCE mode defined in ://ift.tt/7Vl5NS9). In this article, we will introduce the first pattern: Authorization Code Flow. But before that, we need to introduce some pre-concepts to facilitate understanding… This

OAuth 2 Detailed Explanation (1): Introduction and Authorization Code Mode Read More »

ElasticSearch study notes

“ElasticSearch Study Notes” is recently learning to use ES, and this blog records the relevant knowledge. Before that, I used PG’s full-text index to do searches… This article is reprinted from https://jiajunhuang.com/articles/2022_10_06-elasticsearch.md.html This site is for inclusion only, and the copyright belongs to the original author.

ElasticSearch study notes Read More »