OpenIdea

Life is short, I write my code.

Generating unique IDs in a distributed environment

解决方案 UUID UUIDs are 128-bit hexadecimal numbers that are globally unique. The chances of the same UUID getting generated twice is negligible. 优点: 性能非常高:本地生成,没有网络消耗。 缺点: 不易于存储:UUID太长,16...

Flask 请求钩子

Flask 请求钩子 请求钩子的作用是对请求进行预处理( preprocessing )和后处理( postprocessing )。 before_first_request before_request after_request teardown_request:处理每个结束后的异常 after_this_request

Linux 技巧

1. vim 黏贴代码格式混乱 :set paste 2. crontab 修改默认编辑器 > select-editor 3. awk # 输出特定列 $ awk '{print $1, $4}' test.txt # 过滤记录 $ awk '$3==0 && $4=="LISTEN" {print $2} ' test.txt # 保留表头 $ a...

Flutter

Flutter 入门

Install Flutter > git clone -b stable https://github.com/flutter/flutter.git > vim ~/.zshrc export PATH=$PATH:~/flutter/bin export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_ST...

Nginx 基础

Nginx 系列

一、简介 NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server 二、安装 # centos sudo vi /etc/yum.repos.d/nginx.repo [nginx] name=nginx ...

Kubernetes [1]

Kubernetes 架构设计与实现原理

一、背景 Kubernetes 的依赖于目前的两大趋势: 容器技术 —— 资源隔离 微服务架构 二、架构设计 Master API Server : 处理来自用户的请求 Controller Manager : 管理控制器进程 Scheduler : 调度器,为 Pod 选择 Node 节点 No...

脏数据可被研究吗?

背景 当今时代,DATA 是一个非常重要的概念。坐在金融大厦的人每天在想,是否能够根据股票的 K线图 发现下一次的发财机会;每个互联网大公司都在拼命收集用户的个人信息,好从中发现新的商机。因为利益的驱动,DATA 在这个时代大行其道,并且随着互联网的影响,信息爆炸式增长,并在这个时代创造出一个新的名词 BIG DATA。数据已经成为这个时代成长的基石。 脏数据可被研究吗? 在信息充斥的...

分布式理论

CAP

CAP Theorem 对于一个分布式系统,不能同时满足以下三点: 一致性(Consistency) 可用性(Availability) 分区容错性(Partition Tolerance) 一致性模型 弱一致性 最终一致性 DNS Gossip ...

Kafka

Kafka

1. What is Kafka? Apache Kafka is developed in Scala and started out at LinkedIn as a way to connect different internal systems. At the time, LinkedIn was moving to a more distributed architect...

RabbitMQ

RabbitMQ

1. What is RabbitMQ? RabbitMQ is a “traditional” message broker that implements variety of messaging protocols. It was one of the first open source message brokers to achieve a reasonable level...