随笔分类 - Software Architecture
摘要:【1】转自 https://mp.weixin.qq.com/s/ybiN5Q89wI0CnLURGUz4vw 大家好,我是 Kaito。这篇文章我想和你聊一聊,关于 Redis 分布式锁的「安全性」问题。Redis 分布式锁的话题,很多文章已经写烂了,我为什么还要写这篇文章呢?因为我发现网上 99
阅读全文
摘要:公网IP,用户就无需经过路由器或交换机,直接可以上网。除此之外,还能够直接被外界所访问到,无需经如何设备,直接连接电脑。 内网IP,内网是不能直接连接外网,比较封闭,但在内网里面可以实现文件管理,应用软件共享、打印机共享等服务. 如公司内部网络. 外网:又称广域网、互联网。是连接不同地区局域网或城域
阅读全文
摘要:Reference [1] https://www.sofastack.tech/blog/seata-distributed-transaction-deep-dive/ 分布式事务有 AT、TCC、Saga 和 XA 四种模式。 AT AT是一种业务无侵入的模式, AT框架自动解析sql, 找到
阅读全文
摘要:Reference [1] https://zhuanlan.zhihu.com/p/111682902 一、读写分离和防止sql注入的必要性(foreword) 1、 读写分离: 一句话定义:读写分离,基本的原理是让主数据库处理事务性增、改、删操作(INSERT、UPDATE、DELETE),而从
阅读全文
摘要:Metrics Metrics即为度量,主要用于监控和服务度量。以key-values的方式进行存储。 Metrics支持以下几种类型: - Gauges: 某个key的value为特定值。 如Guages(haha, 3), 则haha这个key对应的value即为3. - Counter: 某个
阅读全文
摘要:Reids Reference [1] https://zhuanlan.zhihu.com/p/62608469 解决问题 主要为了解决性能问题. 计数器&统计数据: 排行榜 列出前100名用户 zset 列出某用户当前名词 任务队列: 定时任务(把时间戳和用户一起做为key放到list里被消费)
阅读全文
摘要:Reference: [1] https://blog.csdn.net/iastro/article/details/53037600 一、需求缘起 分页需求 互联网很多业务都有分页拉取数据的需求,例如: (1)微信消息过多时,拉取第N页消息 (2)京东下单过多时,拉取第N页订单 (3)浏览58同
阅读全文
摘要:Reference: [1] https://zhuanlan.zhihu.com/p/61901608 Service Mesh作为下一代微服务技术的代名词,初出茅庐却深得人心一鸣惊人,大有一统微服务时代的趋势。 那么到底什么是Service Mesh? 一言以蔽之:Service Mesh是微服
阅读全文
摘要:转自 [1]. https://www.infoq.cn/article/Qg2tX8fyw5Vt-f3HH673 一、限流的作用 由于 API 接口无法控制调用方的行为,因此当遇到瞬时请求量激增时,会导致接口占用过多服务器资源,使得其他请求响应速度降低或是超时,更有甚者可能导致服务器宕机。 限流
阅读全文
摘要:SLA服务等级协议 Service Level Agreement,包括: 服务目录:如feed流(推荐信息流) 服务可用性:99.9,99.99等 服务故障恢复时间:多长时间可以恢复如10分钟 依赖性 强依赖:挂掉后用户无法使用 弱依赖:挂掉后用户可以使用,但体验不佳 核心依赖:挂掉后用户体验损伤
阅读全文
摘要:Reference [1] https://blog.csdn.net/allenlinrui/article/details/6675998 Nginx 轻量级,采用 C 进行编写,同样的 web 服务,会占用更少的内存及资源 抗并发,nginx 以 epoll and kqueue 作为开发模型
阅读全文
摘要:Reference [1] https://refactoring.guru/design-patterns/adapter 1. Adapter Design Pattern 适配器模式 Adapter is a structural design pattern, which allows in
阅读全文
摘要:Rendezvous Hashing Rendezvous or highest random weight (HRW) hashing is an algorithm that allows clients to achieve distributed agreement on a set of
阅读全文
摘要:Reference [1] https://www.jianshu.com/p/5cc07eae1a0c 批处理 Batch Processing 批处理在大数据世界有着悠久的历史。批处理主要操作大容量静态数据集,并在计算过程完成后返回结果。 批处理模式中使用的数据集通常符合下列特征: 有界:批处理
阅读全文
摘要:Reference [1] 【转】https://blog.csdn.net/zeb_perfect/article/details/54135506 [2] https://blog.csdn.net/xlgen157387/article/details/79530877 缓存穿透 缓存穿透是指
阅读全文
摘要:Reference [1] https://zhuanlan.zhihu.com/p/38969245 方法1: 对单个数据的更新,可以使用CAS(Compare-and-Swap)指令。 伙计们的操作变成下面这个过程: 伙计A看了下总账户余额是1200,然后记住这个数字,回来计算1200+50=1
阅读全文
摘要:Reference [1] https://www.cnblogs.com/eric-qin/p/7238278.html [2] https://zhuanlan.zhihu.com/p/38291558 [3] https://www.cnblogs.com/jsjwk/p/9597748.ht
阅读全文
摘要:[1] https://www.sohamkamani.com/blog/2016/03/14/wrapping-your-head-around-async-programming/ [2] https://codewala.net/2015/07/29/concurrency-vs-multi-
阅读全文
摘要:Reference [1] https://redis.io/topics/distlock [2] https://dzone.com/articles/distributed-lock-using [3] https://en.wikipedia.org/wiki/Distributed_loc
阅读全文
摘要:Reference [1] https://stackoverflow.com/questions/3538021/why-do-we-use-base64 [2] https://dzone.com/articles/base64-encoding-java-8 It is better to c
阅读全文