西维蜀黍

【Engineering】规则引擎(Rule Engine)

  ...


【Network】端口转发(Port Forward)

Forward A Local Port to A Local/External Port

ssh

Refer to https://swsmile.info/post/linux-ssh-usage/

socat

Refer to https://swsmile.info/post/linux-socat/

iptables

Refer to https://swsmile.info/post/linux-iptables/

  ...


【FreeBSD】pfctl

PF (Packet Filter)

PF (Packet Filter, also written pf) is a BSD licensed stateful packet filter, a central piece of software for firewalling. It is comparable to netfilter (iptables), ipfw, and ipfilter.

PF was developed for OpenBSD, but has been ported to many other operating systems.

Usages

Show

# shows how it has interpreted the filtering rules in your config file, including substitutions and defaults
$ pfctl -s

# Shows the NAT rules
sudo pfctl -s nat (or pfctl -sn): 

# Shows all the things
sudo pfctl -s all (or pfctl -sa): 
  ...


【Database】Column-oriented DBMS(列式数据库管理系统)

Background

A relational database management system provides data that represents a two-dimensional table of columns and rows. For example, a database might have this table:

RowId EmpId Lastname Firstname Salary
001 10 Smith Joe 60000
002 12 Jones Mary 80000
003 11 Johnson Cathy 94000
004 22 Jones Bob 55000

This simple table includes an employee identifier (EmpId), name fields (Lastname and Firstname) and a salary (Salary). This two-dimensional format is an abstraction. In an actual implementation, storage hardware requires the data to be serialized into one form or another.

The most expensive operations involving hard disks are seeks. In order to improve overall performance, related data should be stored in a fashion to minimize the number of seeks. This is known as locality of reference, and the basic concept appears in a number of different contexts. Hard disks are organized into a series of blocks of a fixed size, typically enough to store several rows of the table. By organizing the table’s data so rows fit within these blocks, and grouping related rows onto sequential blocks, the number of blocks that need to be read or sought is minimized in many cases, along with the number of seeks.

A survey by Pinnecke et al.[1] covers techniques for column-/row hybridization as of 2017.

  ...


【Architecture】System Design - Budget/Quota System

Background

  • Operators of a E-commerce platform wanna control the budget allocated to a specified promotion.
    • E.g, for big sellers (especially), they would like to set a special Shipping Fee rule/promotion (cap, time period, etc) for certain days like Super Brand Day, or local Super Brand Day. And during those big events, a budget cap is involved.
  • So as to
    • Increase the adoption of promotions created by sellers, which may save the E-commerce’s platform’s costs
    • Provide an finer granularity to control promotions, in terms of especially costs
  ...