Developer Weekly 16

Write-Ahead Log
复杂度应对之道 – COLA应用架构

代码防腐实用技术
Flink学习–Flink on Yarn
技术分享:Prometheus是怎么存储数据的(陈皓)
程序员修炼之道读书笔记
When you need file storage for your project, website, or application, Web3.Storage is here for you.
万字详文阐释程序员修炼之道
容器日志采集利器Log-Pilot
Java线上问题排查神器Arthas快速上手与原理浅谈
监控日志系列—- Filebeat原理
深入Spring Boot:ClassLoader的继承关系和影响
天涯 kkndme 神贴聊房价

Developer Weekly 15

使用 JavaScript,将一个哈希值转成 SVG 图形
the-rise-and-fall-of-the-olap-cube
热重载指的是,在不重启的情况下更新应用。脚本语言都能支持这个功能,本文通俗地讲解,如何让 C 语言这样的编译语言,也支持热重载。
boltdb 源码分析
LSM-Tree 与 LevelDB 的原理和实现
深入理解什么是LSM-Tree
LevelDB 源码分析
如何用Netty写一个高性能的分布式服务框架?
Althttpd is a simple webserver
深入剖析Linux IO原理和几种零拷贝机制的实现
Linux I/O 原理和 Zero-copy 技术全面揭秘
技术文章摘抄
前沿 | 最快KV引擎!存储顶会FAST’20论文揭秘Tair创新性引擎
看了几篇FAST 2020
平衡二叉树、B树、B+树、B树 理解其中一种你就都明白了
二叉树、平衡二叉树、红黑树、B树、B+树与B

Project Loom: Java on Fiber
Go语言之禅
Implementing a world fastest Java int-to-int hash map*
Replicate your Key Value Store across your network, with consistency, persistance and performance.
Packet Traveling
Off-heap memory in Java
Spring Boot Memory Performance

Developer Weekly 14

从零开始写数据库:500行代码实现 LSM 数据库
从零开始写KV数据库:基于哈希索引
Java 日志框架冲突问题排查与总结
使用 Rust 构建分布式 Key-Value Store
Open source racing game developed by everyone willing
Flink教程
聊聊MyBatis缓存机制
Caching of MyBatis query results
Understanding LSM Trees: What Powers Write-Heavy Databases
You Complete Me
Magician | 异步非阻塞的网络协议解析包
CAP 定理解读
HTTP 安全标头快速参考
Java 堆外内存、零拷贝、直接内存以及针对于NIO中的FileChannel的思考
Redis高级客户端Lettuce详解
你真的了解Flink Kafka source吗?
Understanding Java Microbenchmark Harness or JMH Tool
Lessons Learned While Implementing a B+Tree
Pogreb – key-value store for read-heavy workloads
Replicate your Key Value Store across your network, with consistency, persistance and performance.
Hello World剧情分析
分布式哈希表 (DHT) 和 P2P 技术
IPFS白皮书 中文版
使用Apache Druid进行海量数据的存储与查询
实时统计分析系统-Apache Druid
异地多活paxos实现:Multi-Master-Paxos-3

龟虽寿

神龟虽寿,犹有竟时。螣蛇乘雾,终为土灰。老骥伏枥,志在千里。烈士暮年,壮心不已。盈缩之期,不但在天。养怡之福,可得永年。幸甚至哉,歌以咏志。

store ip ranges in Redis

store ip ranges in Redis

It depends if you consider your IP ranges can overlap or not. If not, the solution is quite simple:

      use a collection of hash to store providers data
      use a zset to index the max value of your ranges
      retrieve the (unique) range whose max value is greater than an IP
      check the the min value of this range is lower than the IP

Example:

Here are my providers. Each of them are identified with an id. Please note I could add more properties attached to each provider:

hmset providers:1 name P1 min 3232235786 max 3232235826
OK
hmset providers:2 name P3 min 1232235786 max 1232235826
OK
hmset providers:3 name P3 min 2232235786 max 2232235826
OK
hmset providers:4 name P4 min 4232235786 max 4232235826
OK

Each time a provider is added in the system, an index must be maintained (manually: this is Redis, not a relational database). Score is the max value, member is the id of the range.

zadd providers:index 3232235826 1 1232235826 2 2232235826 3 4232235826 4
(integer) 4
zrange providers:index 0 -1
1) "2"
2) "3"
3) "1"
4) "4"

Now to query the unique range corresponding to an IP address, you need 2 roundtrips:

zrangebyscore providers:index 3232235787 +inf LIMIT 0 1
1) "1"
hgetall providers:1
1) "name"
2) "P1"
3) "min"
4) "3232235786"
5) "max"
6) "3232235826"

Then the client program just has to check that your IP is greater or equal than the minimum address of the returned range.

Developer Weekly 12

This is strictly a violation of the TCP specification

每个程序员都应该知道的内存知识 (带你走读Ulrich Drepper的经典论文)

Introduction to Apache Flink for Spark Developers : Flink vs Spark

Flink 源码分析 — StreamExecutionEnvironment

An iterative algorithm to generate high quality triangulated images.

代码的马斯洛金字塔

(1)第一层:正确(Correct)

代码是否执行预期的工作?是否考虑了边缘情况?是否经过充分测试?是否有可维护性?是否有可接受的性能?

(2)第二层:安全(Secure)

代码是否存在漏洞?数据是否安全存储?个人识别信息(PII)是否得到正确处理?是否对用户的输入进行了全面的验证?

(3)第三层:可读(Readable)

代码是否易于阅读和理解?测试足够简洁吗?变量、函数、类的名称是否适当?使用领域模型是否可以清晰地映射现实世界,以减少认知负担?是否使用一致的编码风格约定?

(4)第四层:优雅(Elegant)

代码是否利用了众所周知的编程模式?能否更简单简洁地实现所需的功能?你会为编写这些代码感到兴奋吗?你为这些代码感到骄傲吗?

(5)第五层:利他主义(Altruist)

别人能否从这些代码学到东西?这些代码是否会激励其他工程师进行改进?它是否会让世界变成一个更好的地方?

程序员修炼之路

线程的中断(Lock与synchronized)

Go treemux + go-pg realworld example application