西维蜀黍

【Architecture】System Design - Flash Sale(秒杀系统)

热点数据

热点数据 比较好理解,那就是用户的热点请求对应的数据。而热点数据又分为“静态热点数据”和“动态热点数据”。

  • 静态热点数据
    • 所谓“静态热点数据”,就是能够提前预测的热点数据。例如,我们可以通过卖家报名的方式提前筛选出来,通过报名系统对这些热点商品进行打标。另外,我们还可以通过大数据分析来提前发现热点商品,比如我们分析历史成交记录、用户的购物车记录,来发现哪些商品可能更热门、更好卖,这些都是可以提前分析出来的热点。
  • 动态热点数据
    • 所谓“动态热点数据”,就是不能被提前预测到的,系统在运行过程中临时产生的热点。例如,卖家在抖音上做了广告,然后商品一下就火了,导致它在短时间内被大量购买。
  ...


【Engineering】Concurrency(并发)vs Parallelism(并行)

Concurrency is not parallelism, although it enables parallelism.

If you have only one processor, your program can still be concurrent but it cannot be parallel.

On the other hand, a well-written concurrent program might run efficiently in parallel on a multiprocessor. That property could be important…

  ...


【TrueNAS】制作 U 盘

Linux

在linux系统中要将TrueNAS安装程序写入U盘,请将U盘插入系统并打开终端。首先,请确保U盘的连接路径正确。

$ lsblk -po +vendor,model

并记下U盘的路径,如lsblk的”NAME“列中所示。

接下来,使用dd将安装程序写入U盘。

$ dd status=progress if=path/to/.iso of=path/to/USB

如果出现“permission denied”错误,请使用具有相同参数的sudo dd并输入管理员密码。使用dd时请务必小心,因为选择错误的“ of =”设备路径可能会导致无法恢复的数据丢失。

  ...


【Network】Mesh

Mesh组网连接方式

目前 Mesh 组网一般都支持有线Mesh、无线Mesh、混合组网,很显然有线Mesh效果是最好的。具体效果如下:

有线Mesh > 无线Mesh三频> 无线Mesh双频

  ...


【Engineering】依赖管理(dependency Managament)

What is a dependency?

In today’s software development world, a dependency is additional code that you want to call from your program. Adding a dependency avoids repeating work already done: designing, writing, testing, debugging, and maintaining a specific unit of code. In this article we’ll call that unit of code a package; some systems use terms like library or module instead of package.

Taking on externally-written dependencies is an old practice: most programmers have at one point in their careers had to go through the steps of manually downloading and installing a required library, like C’s PCRE or zlib, or C++’s Boost or Qt, or Java’s JodaTime or JUnit. These packages contain high-quality, debugged code that required significant expertise to develop. For a program that needs the functionality provided by one of these packages, the tedious work of manually downloading, installing, and updating the package is easier than the work of redeveloping that functionality from scratch. But the high fixed costs of reuse mean that manually-reused packages tend to be big: a tiny package would be easier to reimplement.

  ...


【Network】反向代理 - frp

Install

# macOS
$ brew install frps

# Ubuntu
$ curl -LO https://github.com/fatedier/frp/releases/download/v0.47.0/frp_0.47.0_linux_amd64.tar.gz; tar -xf frp_0.47.0_linux_amd64.tar.gz
  ...


【Engineering】Semantic Versioning

Summary

Given a version number MAJOR.MINOR.PATCH, increment the:

  1. MAJOR version when you make incompatible API changes
  2. MINOR version when you add functionality in a backwards compatible manner
  3. PATCH version when you make backwards compatible bug fixes

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

  ...


【Database】索引 - 哈希索引 VS B+ Tree 索引

哈希索引 VS B+树索引

可能很多人又有疑问了,既然 Hash 索引的效率要比B+树高很多,为什么大家不都用 Hash 索引而还要使用B+树索引呢?

  ...


【Database】存储引擎(Storage Engine)

  ...


【Database】索引 - Build an LSM-tree Database

  ...