-
Access Mysql in a Serializable Way
go ·Goroutine is a magic which allows us to run our logic in a single routine. When it comes to the database, the single routine allow us make access serializable. There is no more lock on the database, which would significantly ramp up the performance, although it may require us write some extra codes.
-
Init Mongo in Docker
database ·This artile introduces a method about how to initialize data for mongodb in docker. We will use
mongoimport
to import data after the mongodb started in docker.
We start another container used to executemongoimport
, which is mongo-seed. -
Back-of-Envelope Estimation
system, design ·Metrics
After clarify the scope and limit of a problem in the system design interview, it is always a good idea to make a preliminary estimation of some metrics for our system. This will help us later when we will be focusing on scaling, partitioning, load balancing and caching.
-
Go Concurrency Tips
Go ·Introduction
Here is some tips of go concurrency regarding the book “Concurrency in Go”.
-
When does a Goroutine terminate?
Go ·Question
If we have a main goroutine(M), a setup goroutine(S), and a work goroutine(W). First, we boot the program with the M never terminated. Then we boot the S within which we start the W. The question is S is alike a parent of W, if S is terminated, will W be terminated?
-
Redirect Custom Variables in Nginx
Network ·Introduction
It is a common demand to leave some information after a proxy server handled the request. At present, we have an auth server and a chat server. The auth server stands between the user request and chat server used for check the authentication. If the request is valid, we want to add user information into the request that...
-
Support Websocket in Nginx
Network ·Introduction
Websocket is an application layer protocol enabling bidirectional communication based on TCP transport protocol, compared with http protocol which only allows client sends to server. So when we want to realize some functions like pushing notification or chatting with different users, it is intuitive to utilize the websocket. However, it takes few more steps to make the Nginx...
-
Nginx Configuration for Microservices
Architecture · -
A Backbone Architecture of A typical Web Application
Architecture · -
【Hard】1157. Online Majority Element In Subarray
Algorithm · -
Writing a Kubernetes Controller
DevOps · -
Cue Overviews for Beginners
DevOps · -
Orchestrate resource startup using init-containers in Kubernetes
DevOps ·```shell #!/bin/bash
wait.sh
#
Usage:
e.g.
sh wait.sh tcp localhost 8080
sh wait.sh http www.google.com 80
# set -e trap exit INT
-
gRPC get starting
DevOps ·Abstract
This article exhibited a demon of grpc project which mainly demonstrate how to get started grpc and integrate it into a typical go project.
-
Collect app dumps on kubernetes
DevOps ·Background
当容器中的应用崩溃时,会使容器发出SIGKILL信号,之后容器会立刻崩溃, 导致程序的dump文件也被一起销毁。为了能够保存dump文件,以便之后调查 分析程序崩溃的原因,所以需要一种机制能够收集并保存dump文件。
-
Automated CICD pipeline on GKE
DevOps ·GKE