
架构设计
文章平均质量分 57
hanruikai
aaa
展开
-
TMF2.0技术揭秘
面临的问题如何快速响应需求,加速发布周期----------建立全链路视角的需求管理机制(需求评估成本高,传递效率低等问题) 如何能为新小业务提供快速支撑,降低准入门槛----------降低准入门槛(平台可以裁剪,快速验证新小业务,POC) 是否足够开放,使得业务方能做到自助式扩展-------------业务与平台分离 新需求是否已经在其他事业部有可复用资产等------------资产可复用互联网系统是按领域服务建设的分布式架构。...原创 2021-05-22 09:43:52 · 816 阅读 · 0 评论 -
HTTP 1.0 vs HTTP 1.1 vs HTTP 2.0
HTTP 1.0 vs 1.1我们先看1.1相比于1.0做了哪些改进:支持代理和Host报文头:1.0没有要求host header,但是可以添加。1.1支持,便于路由和代理 支持持久化链接:在同一个Http链接上传输多个报文,1.0要求每个请求/响应必须创建一个新的链接 支持缓存:1.0仅仅支持If-Modified-Since header,1.1增加了entity trag和If-Unmodified-Since, If-Match, If-None-Match 等条件请求头 100状.原创 2021-01-11 16:52:15 · 518 阅读 · 0 评论 -
什么是单页面应用(SPA)和多页面应用(MPA)
背景最初我们的应用都是多页面应用,多页面应用就是每次客户单请求都返回一个新的页面。在互联网初期,这个问题并没有带来很差的用户体验,但是随着移动互联网的发展以及用户的体验,开发者开始考虑,为什么我们每次只更改了页面的一部分数据,却要更新整个页面呢?所有的反思促使了技术的进步。我们是不是可以第一次加载全部的页面内容,以后的更新,仅仅更新变化的数据,答案是可以的,这就是单页面应用SPA。下图是总体上比较单页面应用和多页面应用的流程:从上图可以看到:多页面应用:每次请求服务端都.原创 2021-01-05 15:13:37 · 1789 阅读 · 0 评论 -
一次搞明白什么是MVC、MVP、MVVM?
1.前言三个框架的共同目的:为了将业务和视图的实现代码分离,从而使同一个程序可以使用不同的表现形式。MVC = Model-View-ControllerMVP = Model-View-PresenterMVVM = Model-View-ViewModel都有Model和View层。Model 为模型层,主要管理业务模型的数据和行为;View 为展示层,其职责就是管理用户界面。三个架构模式目的都是为了解耦 Model 和 View,主要不同点就在于三者实现解耦的方案不同。2.MV原创 2020-12-17 14:34:03 · 919 阅读 · 0 评论 -
Spring boot+Shiro+ spring MVC+swagger UI +Mybatis+mysql+Vue +Element UI 之一vue和spring boot整合
1 为什么是vue+spring boot技术选型核心框架:Spring Boot 1.5安全框架:Apache Shiro 1.3视图框架:Spring MVC 4.3持久层框架:MyBatis 3.3定时器:Quartz 2.3数据库连接池:Druid 1.0日志管理:SLF4J 1.7、Log4j页面交互:Vue2.x为什么是MVVM那么在我继续之前,我也想和大家回顾一下Web开发的发展简史...原创 2017-12-21 14:36:50 · 4341 阅读 · 1 评论 -
Spring boot+Shiro+ spring MVC+swagger UI +Mybatis+mysql+Vue +Element UI 之二 vue 环境演示
前面说到如何整合spring boot 和vue进行前后端独立并行开发,今天讲解一下如何构建vue到开发环境1. npm install 执行npm install命令安装依赖,前提是安装npm hanruikaideMacBook-Pro:flow-platform-manage-html hanruikai$ npm installnpm WARN The package less is i...原创 2018-01-02 11:49:45 · 1072 阅读 · 0 评论 -
微服务架构漫谈
1. 概述微服务:2014 年可以认为是微服务 1.0 的元年,当年有几个标志性事件,一是 Martin Fowler 在其博客上发表了”Microservices”一文,正式提出微服务架构风格;二是 Netflix 微服务架构经过多年大规模生产验证,最终抽象落地形成一整套开源的微服务基础组件,统称 NetflixOSS,Netflix 的成功经验开始被业界认可并推崇;三是 Pivotal 将 N...原创 2018-03-21 19:03:55 · 655 阅读 · 0 评论 -
横表和纵表的概念以及应用场景
横表就是普通的建表方式,如一个表结构为:主键、字段1、字段2、字段3。。。 如果变成纵表后,则表结构为: 主键、字段代码、字段值。而字段代码则为字段1、字段2、字段3。 具体为电信行业的例子。以用户帐单表为例一般出账时用户有很多费用客户,其数据一般存储为:时间,客户ID,费用科目,费用。这种存储结构一般称为纵表,其特点是行数多,字段少。纵表在使用时由于行数多,统计用户数或对用户进行分档时还需要进...转载 2018-03-28 16:42:49 · 6441 阅读 · 0 评论 -
Mysql主键选择之UUID和自增主键
引言之前有段时间用postgresql 数据库,在上云之后,从自增主键变为uuid,感觉uuid全球唯一,很方便。最近用mysql,发现mysql主键都是选择自增主键,仔细比较一下,为什么mysql选择自增主键,有什么不同。在mysql5.0之前,如果是多个master复制的环境,无法用自增主键,因为可能重复。在5.0以及之后的版本通过配置自增偏移量解决了整个问题。什么情况下我们希望用uuid1....原创 2018-03-29 11:44:03 · 17715 阅读 · 0 评论 -
微服务调用之重试和负载均衡
Retry机制微服务架构中,需要频繁调用各个service进行业务逻辑交互,如果调用失败,如何处理,如何重试?spring cloud提供了retry机制。 @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public boolean collideThridWhiteList(User user, String c...原创 2018-05-24 16:01:21 · 3028 阅读 · 0 评论 -
java框架篇spring cloud之服务发现consul
1 前言 上篇文章提到利用eureka做服务发现,spring config server做集中配置,但是由于eureka 2.0已经停止开源开发,建议开发者切换到consul或者zookeeper上。除了上篇文件提到的架构:我们可以考虑利用consul实现集中配置和服务发现。2 服务发现spring cloud提供了多个服务发现框架集成,euerka已经停止开发了,目...原创 2018-09-11 10:55:58 · 3027 阅读 · 0 评论 -
Java框架篇spring sleuth分布式日志查询
前言随着微服务数量不断增长,需要跟踪一个请求从一个微服务到下一个微服务的传播过程, Spring Cloud Sleuth 正是解决这个问题,它在日志中引入唯一ID,以保证微服务调用之间的一致性,这样你就能跟踪某个请求是如何从一个微服务传递到下一个。 如果你有使用AOP拦截Servlet的经验,做一个基于AOP的简单服务统计和跟踪很容易。但要像Zipkin那样能够跟踪服务调用链就比较困难...原创 2018-09-19 19:58:00 · 951 阅读 · 1 评论 -
java架构篇NodeJS,Vue,前后端分离都是什么鬼
1.Node.JSnode.js是开源的,跨平台的,浏览器之外的Js运行环境。前后端统一语言开发。主要特点事件驱动 异步IO 基于Google的V8引擎,V8引擎执行Javascript的速度非常快,性能非常好 单线程,单进程优点:容易学习,全栈开发----统一语言 高并发----异步IO 高性能 ---JS直接转换为机器码,处理性能更高 高吞吐量和扩展性 适合IO密集...原创 2018-10-29 12:07:28 · 2517 阅读 · 0 评论 -
LeetCode刷题EASY篇反转一个带符号的整数
题目Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are...原创 2018-10-31 18:12:16 · 296 阅读 · 0 评论 -
LeetCode刷题EASY篇如何快速反转一个字符串
题目Write a function that takes a string as input and returns the string reversed.Example 1:Input: "hello"Output: "olleh"Example 2:Input: "A man, a plan, a canal: Panama"Output: "amanaP :...原创 2018-10-31 19:47:44 · 481 阅读 · 0 评论 -
LeetCode刷题Medium篇寻找字符串中最长的回文子串(动态规划解法)
题目Given a strings, find the longest palindromic substring ins. You may assume that the maximum length ofsis 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer....原创 2018-10-31 19:52:27 · 1140 阅读 · 0 评论 -
LeetCode刷题EASY篇合并两个有序的链表
题目Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Output...原创 2018-11-06 11:29:30 · 442 阅读 · 0 评论 -
LeetCode刷题EASY篇寻找多个字符串的最长公共前缀
题目Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "".Example 1:Input: ["flower","flow","flight"]Out...原创 2018-11-06 12:06:04 · 874 阅读 · 0 评论 -
手动增加lib到m2目录,maven不能自动download情况下
hanruikaideMacBook-Pro:Downloads hanruikai$ mvn install:install-file -DgroupId=net.sf.proguard -DartifactId=proguard-base -Dversion=5.3.3 -Dpackaging=jar -Dfile=proguard-base-5.3.3.jar -DgeneratePom...原创 2018-11-09 11:06:06 · 379 阅读 · 0 评论 -
LeetCode刷题MEDIM篇线性时间查找整型数组中最大的k个数
题目一个整数数组,n个元素,寻找最大的m个数,时间复杂度为O(n) 分析以前美团面试问过,后来也没有研究一下,现在学习一下解题思路。最大的n个,显然其他的不关系,n个元素之间的关系也不关心,考虑用快速排序,因为快速排序一遍之后,privotkey对应的元素就是第privotkey大的元素。对了,这里说的第几大貌似不是正确的意思,是从小开始数的第几大,没有关系,为了代码方便实现,...原创 2018-11-07 17:11:12 · 370 阅读 · 0 评论 -
leetcode刷题之EASY篇什么是尾部递归
Consider a simple function that adds the first N integers. (e.g. sum(5) = 1 + 2 + 3 + 4 + 5 = 15).Here is a simple JavaScript implementation that uses recursion:function recsum(x) { if (x===1...原创 2018-11-05 18:54:38 · 203 阅读 · 0 评论 -
LeetCode刷题Easy篇删除有序数组中的重复元素
题目Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by mod...原创 2018-11-13 14:47:04 · 295 阅读 · 0 评论 -
LeetCode刷题Easy篇移除数组中为指定数值的所有元素
题目Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input ...原创 2018-11-13 15:29:53 · 292 阅读 · 0 评论 -
LeetCode刷题EASY篇罗马数字转换为整型数字表示
题目Roman numerals are usually written largest to smallest from left to right. However, the numeral for four is not IIII. Instead, the number four is written as IV. Because the one is before the five ...原创 2018-11-08 11:15:55 · 266 阅读 · 0 评论 -
LeetCode刷题EASY篇有效的插入符
题目Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type ...原创 2018-11-08 13:56:44 · 266 阅读 · 0 评论 -
LeetCode刷题Easy篇实现java里面的indexOf方法
题目Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Exa...原创 2018-11-14 10:27:58 · 278 阅读 · 0 评论 -
LeetCode刷题Easy篇寻找元素插入位置
题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the arra...原创 2018-11-14 11:27:40 · 219 阅读 · 0 评论 -
LeetCode刷题Easy篇爬楼梯问题(递归和动态规划问题)
题目You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a posi...原创 2018-11-20 16:48:56 · 789 阅读 · 0 评论 -
LeetCode刷题Easy篇斐波那契数列问题(递归,尾递归,非递归和动态规划解法)
题目斐波那契数列: f(n)=f(n-1)+f(n-2)(n>2) f(1)=1;f(2)=1;即有名的兔子繁衍问题 1 1 2 3 5 8 13 21 ....我的解法递归package com.puhui.goosecard.manage;/** * 2 * @Author: kerry * 3 * @Date: 2018/12/7 10:18 * 4...原创 2018-11-21 11:35:46 · 1004 阅读 · 1 评论 -
LeetCode刷题Easy篇寻找最大和的连续子数组(kadane算法和动态规划)
题目Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Ex...原创 2018-11-16 17:55:48 · 1101 阅读 · 0 评论 -
LeetCode刷题Easy篇两个二进制字符串相加,“和”也是二进制字符串
题目Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = "11", b = "1"Output: "100"...原创 2018-11-21 17:57:43 · 485 阅读 · 0 评论 -
LeetCode刷题Easy篇二叉树遍历
题目二叉树的前序,中序,后序遍历Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1Breadth First or L...原创 2018-11-23 17:15:12 · 298 阅读 · 0 评论 -
LeetCode刷题Easy篇合并两个有序数组
题目Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively. You may assume...原创 2018-11-22 17:30:31 · 240 阅读 · 0 评论 -
LeetCode刷题Easy篇反转单链表
题目Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or rec...原创 2018-11-22 19:35:49 · 229 阅读 · 0 评论 -
LeetCode刷题Easy篇寻找最后一个字符串的长度
题目Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word does not exist, return 0.Note:A word is d...原创 2018-11-20 11:16:05 · 229 阅读 · 0 评论 -
LeetCode刷题Easy篇移除有序链表中的重复元素
题目Given a sorted linked list, delete all duplicates such that each element appear only once.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->3->3Output...原创 2018-11-20 11:47:21 · 303 阅读 · 0 评论 -
LeetCode刷题Easy篇两个二叉树是否相同
题目Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.Exam...原创 2018-11-23 15:12:43 · 272 阅读 · 0 评论 -
LeetCode刷题Easy篇判断一个二叉树是否对称
题目Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 ...原创 2018-11-29 16:12:40 · 541 阅读 · 0 评论 -
LeetCode刷题Easy篇Binary Tree Level Order Traversal II
题目Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,...原创 2018-12-04 10:55:15 · 214 阅读 · 2 评论 -
LeetCode刷题Easy篇Convert Sorted Array to Binary Search Tree
题目Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of...原创 2018-12-04 14:02:27 · 207 阅读 · 0 评论