Postgres ID Generator with Safe JSON Numbers

Ggicci
Before reading this post, I recommend you to read A Better ID Generator For PostgreSQL written by Rob Conery. To recap briefly, their post had discussed: The problem you will face in the rapid grow of your systems if you used GUID as the primary key. How Twitter generating auto-incrementing keys with Snowflake. Create a functional Snowflake equivalent for PostgresSQL. And the third point above will be the focus of discussion in this post.

Decode HTTP Query Params Into a Struct in Golang

Ggicci
Many people use net/http package directly in Go to deal with HTTP requests, including reading URL parameters, HTTP headers, and the request body. It’s straightforward and efficient, though. We can still get bored writing so much tedious code for just reading and parsing the URL params. Typically when we are maintaining a service with hundres of APIs. Parse URL Params with net/http Let’s see a piece of code for dealing with HTTP requests by using net/http package:

Deploying an AES-128 Encrypted HTTP Live Stream (HLS)

Ggicci
HTTP Live Streaming (HLS) is an HTTP-based adaptive bitrate streaming communications protocol developed by Apple Inc. and released in 2009. Some key points of HLS: Created by Apple. Consists of a playlist/manifest file (e.g. index.m3u8) and segment video files (e.g. index01.ts). H264 codec of video + AAC of audio. Use HTTP, easily leveraging CDN to reach the widest audience without worring about the bandwidth and firewalls. Adaptive streaming, enables changing the quality of the video mid-stream.

Open Source Contribution Workflow Best Practice

Ggicci
Generally speaking, as we were using some open-source libraries we will inevitably find that there are some bugs or points that can be improved. And sometimes we even have to develop a brand new feature based on these libraries to satisfy our own needs. Out of respect for sprit of dedication, contributing our code to these opensource libraries is a good way to give back to the community. My Practice When I decided to contribute to a repository, I will first try looking for if there is a contribution guide for it.

Reduce Docker Image Size by Using Multi-stage Builds

Ggicci
If you don’t take any optimization measures, docker images can easily get large. And in most cases we just wrapped too many inessential things into the images. So, we should take actions to get rid of it.