上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
业务层经常做的一些判断: public String addUser(User user) { if (user == null || user.getId() == null || user.getAccount() == null || user.getPassword() == null || Read More
posted @ 2020-07-29 16:20 AlexZS Views(1614) Comments(0) Diggs(0) Edit
一、分库分表的方式 1、垂直分表: 将一个表拆分为多个表,按照字段使用频率,热度进行拆分,拆分后的表仍然在同一个库中 带来的提升: 减少IO争抢导致锁表的几率,查询看商品详情与商品信息浏览互不影响。 提供热门数据操作效率 拆分原则: 把访问频率比较低字段单独放一张表中 把txt,blob等大字段拆分 Read More
posted @ 2020-07-28 17:35 AlexZS Views(353) Comments(0) Diggs(0) Edit
一、将未add 进去的文件还原 eg: (1)创建a.txt 和b.txt 文件 (2)修改 添加一些内容至a.txt文件中 (3)还原 --使用 git checkout 命令 ps:checkout 命令只会讲被修改的文件恢复成stage状态,用这个例子来说,a.txt 没有被add 命令执行, Read More
posted @ 2020-07-20 15:12 AlexZS Views(89) Comments(0) Diggs(0) Edit
静态构造方法 静态构造方法的语义和简化程度真的高于直接去 new 一个对象。比如 new 一个 List 对象,过去的使用是这样的: List<String> list = new ArrayList<>(); Guava 中的创建方式: List<String> list = Lists.newA Read More
posted @ 2020-07-17 09:53 AlexZS Views(114) Comments(0) Diggs(0) Edit
Json对象 var str = {"姓名":"张三","性别":"男","年龄":"20"}; Json字符串 var str = '{"姓名":"张三","性别":"男","年龄":"20"}'; eg: var str='{ "name": "John" }'; // Json字符 Read More
posted @ 2020-07-14 16:48 AlexZS Views(193) Comments(0) Diggs(0) Edit
Spring Cloud 支持的服务发现软件以及特性对比 FeatureeuerkaConsulzookeeperetcd 服务健康检查 可配支持 服务状态,内存,硬盘等 (弱)长连接,keepalive 连接心跳 多数据中心 — 支持 — — kv 存储服务 — 支持 支持 支持 一致性 — ra Read More
posted @ 2020-07-07 14:40 AlexZS Views(155) Comments(0) Diggs(0) Edit
上一个使用了Eureka作为注册中心,基于Spring Cloud实现服务的发布与调用。而在18年7月份,Eureka2.0宣布闭源了 省略zookeeper安装步骤 order模块 application.yml server: port: 10080 spring: application: n Read More
posted @ 2020-07-07 11:18 AlexZS Views(1282) Comments(0) Diggs(0) Edit
一、服务发现简介 1.服务提供者、服务消费者、服务发现组件三者之间的关系大致如下: 各个微服务在启动时时,将自己的网络地址等信息注册到服务发现组件上(eureka,zookeeper,Consul),服务发现组件会存储这些信息。服务消费者会从服务发现组件查询服务提供者的网络地址,然后根据该地址调用服 Read More
posted @ 2020-07-06 15:11 AlexZS Views(112) Comments(0) Diggs(0) Edit
使用 EXPLAIN 函数可以清楚的查看语句的执行情况 EXPLAIN select id from b_nc_card where id != 10000; 一共查询了:530912 行 优化后 EXPLAIN (select id from b_nc_card where id > 10000) Read More
posted @ 2020-06-19 18:55 AlexZS Views(358) Comments(0) Diggs(0) Edit
根据某一条件从数据库表中查询 『有』与『没有』,只有两种状态,那为什么在写SQL的时候,还要SELECT count(*) 呢? 业务代码中,需要根据一个或多个条件,查询是否存在记录,不关心有多少条记录。普遍的SQL及代码写法如下 ##### SQL写法: SELECT count(*) FROM Read More
posted @ 2020-06-18 16:59 AlexZS Views(245) Comments(0) Diggs(0) Edit
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页