Spring与SpringBoot

目录

前言

1、Spring能做什么

1.1、Spring的能力

1.2、Spring的生态

1.3、Spring5重大升级

1.3.1、响应式编程

1.3.2、内部源码设计

2、为什么用SpringBoot

2.1、SpringBoot优点

2.2、SpringBoot缺点

3、时代背景

3.1、微服务

3.2、分布式

分布式的困难

分布式的解决

3.3、云原生(Cloud Native)

上云的困难

上云的解决

4、如何学习SpringBoot

4.1、官网文档架构


前言

1、Spring能做什么

1.1、Spring的能力

1.2、Spring的生态

官网:Spring Boot

覆盖了:

  • web开发
  • 数据访问
  • 安全控制
  • 分布式
  • 消息服务等等

 做以上服务都可以从springBoot开始,所以【boot】也有开始之意

1.3、Spring5重大升级

1.3.1、响应式编程

1.3.2、内部源码设计

基于Java8的一些新特性,如:接口默认实现。重新设计源码架构。

2、为什么用SpringBoot

Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".

能快速创建出生产级别的Spring应用

2.1、SpringBoot优点

  • Create stand-alone Spring applications
    • 创建独立Spring应用
  • Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
    • 内嵌web服务器
  • Provide opinionated 'starter' dependencies to simplify your build configuration
    • 自动starter依赖,简化构建配置
  • Automatically configure Spring and 3rd party libraries whenever possible
    • 自动配置Spring以及第三方功能
  • Provide production-ready features such as metrics, health checks, and externalized configuration
    • 提供生产级别的监控、健康检查及外部化配置
  • Absolutely no code generation and no requirement for XML configuration
    • 无代码生成、无需编写XML

总结

SpringBoot是整合Spring技术栈的一站式框架

SpringBoot是简化Spring技术栈的快速开发脚手架

2.2、SpringBoot缺点

  • 人称版本帝,迭代快,需要时刻关注变化
  • 封装太深,内部原理复杂,不容易精通

3、时代背景

3.1、微服务

James Lewis and Martin Fowler (2014) 提出微服务完整概念。Microservices Guide

In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized management of these services, which may be written in different programming languages and use different data storage technologies.-- James Lewis and Martin Fowler (2014)

  • 微服务是一种架构风格
  • 一个应用拆分为一组小型服务
  • 每个服务运行在自己的进程内,也就是可独立部署和升级
  • 服务之间使用轻量级HTTP交互
  • 服务围绕业务功能拆分
  • 可以由全自动部署机制独立部署
  • 去中心化,服务自治。服务可以使用不同的语言、不同的存储技术

3.2、分布式

分布式的困难

  • 远程调用(不同服务器上,比如A调用B,B调用C)
  • 服务发现(A调用B的时候怎么知道B的哪台服务器是好的)
  • 负载均衡(即将负载(工作任务)进行平衡、分摊到多个操作单元上进行运行)
  • 服务容错(对于成百上千个调用,要求具有一定的容错性来容忍调用执行出现失败的状况)
  • 配置管理
  • 服务监控
  • 链路追踪(A调用B,B调用C,C调用D...,如果出现错误,那么需要追踪整条链看看错误发生在哪)
  • 日志管理
  • 任务调度
  • ......

分布式的解决

  • SpringBoot + SpringCloud

3.3、云原生(Cloud Native)

原生应用如何上云。

上云的困难

  • 服务自愈(C服务器崩了,能否拉起另一台C服务器)
  • 弹性伸缩(当流量很大时,两台C不够用,能否自动拉起多台C,当流量减少,再将多台C下线)
  • 服务隔离(不同服务器运行不干扰)
  • 自动化部署(自动部署到云服务器上)
  • 灰度发布(即版本控制,假设B出了2.0版本,那么先找一部分B使用2.0版本先试试一段时间)
  • 流量治理(对每一台服务器的吞吐量进行治理。比如,若有一台B性能不太行,那么打到这台B的流量就应该少一些)
  • ......

上云的解决

4、如何学习SpringBoot

4.1、官网文档架构

查看版本新特性;

https://github.com/spring-projects/spring-boot/wiki#release-notes

  • 9
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 14
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zoeil

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值