This deck provides a side-by-side comparison between two popular cloud native programming models: MicroProfile vs. Spring boot. It lists similiarilities and differences between them
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Cloud native programming model comparison
1. Emily Jiang, Java Champion
Senior Technical Staff Member, IBM
Liberty Microservice Architect, Advocate
Senior Lead for MicroProfile and CDI
@emilyfhjiang
Creating a cloud-native microservice
– which programming model should I use?
6. Open specifications
Wide vendor support
REST services
OpenAPI support
Security
Fault Tolerance
Configuration
Metrics
Health
Open Tracing
https://wiki.eclipse.org/MicroProfile/Implementation
MicroProfile Implementations
@emilyfhjiang
7. Spring MicroProfile
Getting started
Starter https://start.spring.io/ https://start.microprofile.io/
REST
REST Service Spring MVC JAX-RS
Dependency Injection Spring IoC & DI CDI
API Documentation Spring REST Docs MP Open API
REST Client Spring MVC
Feign
MP REST Client
JSON Binding/Processing Bring Your Own Llibrary
Jackson, JSON-B
JSON-B
JSON-P
Reactive
Reactive Spring Reactor
Use Kafka APIs to connect
with Kafka
MicroProfile Reactive Streams
Operator, RxJava
MicroProfile Reactive
Messaging
Handling 100s of Services
Configuration Spring Boot Config
Spring Cloud Config
MP Config
Fault Tolerance Netflix Hystrix MP Fault Tolerance
Security Spring Security
Spring Cloud Security
EE Security
MP JWT Propagation
Operation Focus
Health Checks Spring Boot Actuator MP Health Check
Metrics Spring Boot Actuator MP Metrics
Distributed Tracing Spring Cloud Sleuth MP Open Tracing
Capabilities
@emilyfhjiang
24. JSON-B & JSON-P in MicroProfile
A B
...
@GET
@Produces(MediaType.APPLICATION_JSON)
public InventoryList listContents() {
return manager.list();
}
public class InventoryList {
private List<SystemData> systems;
public InventoryList(List<SystemData> systems) {
this.systems = systems;
}
public List<SystemData> getSystems() {
return systems;
}
public int getTotal() {
return systems.size();
}
}
@emilyfhjiang
25. Reactive
MicroProfile Reactive Stream Operators
to work with Reactive Streams
Can also use RxJava
MicroProfile Reactive Messaging
Spring
MicroProfile
Use Spring Reactor
Directly use Kafka APIs or Spring boot
annotations to interact with Kafka
streams
@emilyfhjiang
36. Distributed Tracing
MP OpenTracing
Configuring this features allows us to generate traces for the application
Custom Trace Implementation
Spring Cloud Sleuth
If the Spring cloud sleuth is configured on the class path, the trace information
will get generated automatically.
Spring
MicroProfile
@emilyfhjiang
38. Takeaway
Developers should be free to choose what
they prefer
Enterprise should provide developers with
platforms that enable innovation and
flexibility and are enterprise and production
ready
Liberty supports both MicroProfile/EE and
Spring
Fast, small, reliable runtime
Optimized for containers and cloud
Spring is popular
MicroProfile and Jakarta EE are evolving
rapidly (and gaining momentum) as
community-driven and standards-based
efforts for developing microservices and
cloud-native applications in enterprise Java
Both Spring and MicroProfile provide
facilities for developers to build next-
generation applications for cloud
Share similarities
There are differences too (and sometimes,
significant)
Lightweight runtimes for Java/Jakarta EE are
readily available nowadays
@emilyfhjiang
39. Spring Impl MicroProfile Impl
Open Source
Driven by Pivotal
Spring way of
things
Open Source
Driven by Community
Open standards
Behaviors in
accordance
specifications
More code
Do what you
want/need with
code (and
configuration)
Less code
Customize server
configuration
Find, mix and
match what you
like
Manage your own
dependencies
Runtime provides
what is needed per
specification
Fat JARs Thin WAR
@emilyfhjiang