摘要: 一、键值设计 1. key名设计 【建议】可读性和可管理性 以业务名(或数据库名)为前缀(防止key冲突),用冒号分隔,比如业务名:表名:id trade:order:1 【建议】简洁性 保证语义的前提下,控制key的长度,当key较多时,内存占用也不容忽视,例如: user:{uid}:frien 阅读全文
posted @ 2022-10-27 18:36 daheww 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Redis是单线程吗? Redis 的单线程主要是指 Redis 的网络 IO 和键值对读写是由一个线程来完成的,这也是 Redis 对外提供键值存储服务的主要流程。但 Redis 的其他功能,比如持久化、异步删除、集群数据同步等,其实是由额外的线程执行的。 Redis 单线程为什么还能这么快? 因 阅读全文
posted @ 2022-10-27 18:31 daheww 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 概述 是什么? 定义: 和MySQL、Oracle等数据库的主要区别: | 数据库 | 存储的位置 | 数据逻辑结构 | | | | | | MySQL、Oracle等数据库 | 硬盘 | 关系型数据 | | Redis | 内存 | key-value | 厉害之处: 性能强 支持的数据结构多:s 阅读全文
posted @ 2022-10-27 18:27 daheww 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 开发手册 网上解释不推荐用java.sql.Date、java.sql.Time的文章有很多,但是解释为什么不推荐使用java.sql.Timestamp文章没找到。 参考文章:一文告诉你Java日期时间API到底有多烂 原因 Oracle官网文档中这么写: 可以看到,根源是因为java.sql.T 阅读全文
posted @ 2022-09-29 13:59 daheww 阅读(612) 评论(0) 推荐(0) 编辑
摘要: /** * Performs blocking or timed wait for a task, depending on * current configuration settings, or returns null if this worker * must exit because of 阅读全文
posted @ 2022-09-25 21:19 daheww 阅读(110) 评论(0) 推荐(0) 编辑
摘要: /** * Checks if a new worker can be added with respect to current * pool state and the given bound (either core or maximum). If so, * the worker count 阅读全文
posted @ 2022-09-25 18:54 daheww 阅读(49) 评论(0) 推荐(0) 编辑
摘要: /** * Checks if a new worker can be added with respect to current * pool state and the given bound (either core or maximum). If so, * the worker count 阅读全文
posted @ 2022-09-23 17:08 daheww 阅读(42) 评论(0) 推荐(0) 编辑
摘要: /** * Executes the given task sometime in the future. The task * may execute in a new thread or in an existing pooled thread. * * If the task cannot b 阅读全文
posted @ 2022-09-22 22:50 daheww 阅读(33) 评论(0) 推荐(0) 编辑
摘要: /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under th 阅读全文
posted @ 2022-09-19 15:14 daheww 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 看到一个没见过的SuppressWarning(@SuppressWarnings("WeakerAccess")),网上也没搜到。 找到一篇文章(@SuppressWarnings values)介绍@SuppressWarning注解。大意是@SuppressWarning的value只是给ID 阅读全文
posted @ 2022-09-15 01:31 daheww 阅读(94) 评论(0) 推荐(0) 编辑