Spring框架内容
Why Spring?
Spring makes programming Java quicker, easier, and safer for everybody.
对所有人来说,用Spring进行JAVA编程,会更快、更容易、更安全。
Spring’s focus on speed, simplicity, and productivity has made it the world's most popular Java framework.
Spring专注于对编程速度、易用度、生产力等方面提升,已经成为世界上最流行的Java框架。
What can Spring do?
- Microservices
微服务
Microservice architectures are the ‘new normal’.
微服务架构正在成为事实标准
Building small, self-contained, ready to run applications can bring great flexibility and added resilience to your code.
创建小的,自包含的,随时可运行的应用程序能够带来极大的灵活性,还能使代码有更强的适应性。
Spring Boot’s many purpose-built features make it easy to build and run your microservices in production at scale.
Spring Boot针对应用的多种自动配置方式,使得其在一定生产范围内变得容易构建和执行。
And don’t forget, no microservice architecture is complete without Spring Cloud ‒ easing administration and boosting your fault-tolerance.
别忘了,没有集成到 Spring Cloud 的微服务框架是不完全的,Spring Cloud可以更容易的对应用进行监控及容错。
What are microservices?
什么是微服务
Microservices are a modern approach to software whereby application code is delivered in small, manageable pieces, independent of others.
微服务是这样一种软件,体量小、可控、相对独立。
Why build microservices?
为什么创建微服务
Their small scale and relative isolation can lead to many additional benefits, such as easier maintenance, improved productivity, greater fault tolerance, better business alignment, and more.
- Reactive
Reactive systems have certain characteristics that make them ideal for low-latency, high-throughput workloads. Project Reactor and the Spring portfolio work together to enable developers to build enterprise-grade reactive systems that are responsive, resilient, elastic, and message-driven. What is reactive processing? Reactive processing is a paradigm that enables developers build non-blocking, asynchronous applications that can handle back-pressure (flow control). Why use reactive processing? Reactive systems better utilize modern processors. Also, the inclusion of back-pressure in reactive programming ensures better resilience between decoupled components.
- Cloud
Developing distributed systems can be challenging. Complexity is moved from the application layer to the network layer and demands greater interaction between services. Making your code ‘cloud-native’ means dealing with 12-factor issues such as external configuration, statelessness, logging, and connecting to backing services. The Spring Cloud suite of projects contains many of the services you need to make your applications run in the cloud.
- Web applications
Spring makes building web applications fast and hassle-free. By removing much of the boilerplate code and configuration associated with web development, you get a modern web programming model that streamlines the development of server-side HTML applications, REST APIs, and bidirectional, event-based systems.
- Serverless
Serverless applications take advantage of modern cloud computing capabilities and abstractions to let you focus on logic rather than on infrastructure. In a serverless environment, you can concentrate on writing application code while the underlying platform takes care of scaling, runtimes, resource allocation, security, and other “server” specifics. What is serverless? Serverless workloads are “event-driven workloads that aren’t concerned with aspects normally handled by server infrastructure.” Concerns like “how many instances to run” and “what operating system to use” are all managed by a Function as a Service platform (or FaaS), leaving developers free to focus on business logic. Serverless characteristics? Serverless applications have a number of specific characteristics, including: Event-driven code execution with triggers Platform handles all the starting, stopping, and scaling chores Scales to zero, with low to no cost when idle Stateless
- Event Driven
Event-driven systems reflect how modern businesses actually work–thousands of small changes happening all day, every day. Spring’s ability to handle events and enable developers to build applications around them, means your apps will stay in sync with your business. Spring has a number of event-driven options to choose from, from integration and streaming all the way to cloud functions and data flows. Event-driven microservices When combined with microservices, event streaming opens up exciting opportunities—event-driven architecture being one common example. Spring simplifies the production, processing, and consumption of events, providing several useful abstractions. Streaming data Streaming data represents a constant flow of events. One example might be a stock ticker. Every time a stock price changes, a new event is created. It’s called “streaming data” because there are thousands of these events resulting in a constant stream of data. Integration The bedrock of any event-driven system is message handling. Connecting to message platforms, routing messages, transforming messages, processing messages. With Spring you can solve these integration challenges quickly.
- Batch
The ability of batch processing to efficiently process large amounts of data makes it ideal for many use cases. Spring Batch’s implementation of industry-standard processing patterns lets you build robust batch jobs on the JVM. Adding Spring Boot and other components from the Spring portfolio lets you build mission-critical batch applications. What is batch processing? Batch processing is the processing of a finite amount of data in a manner that does not require external interaction or interruption. Why build batch processes? Batch processes are an extremely efficient way of processing large amounts of data. The ability to schedule and prioritize work based on SLAs lets you allocate resources for best utilization.