Spring I/O 2024: Building Production-Ready Applications with Java, AI, and Spring
0:00:15 Introduction: The speaker, Josh Long from the Spring team, welcomes attendees and outlines the plan to cover topics from basic to high-level in three hours.
0:01:54 State of Technology: Josh emphasizes the incredible moment in time where technology, society, and development efforts are aligning, urging developers to be awake and pay attention.
0:03:49 Sample Application: Two domain options are proposed for the tutorial sample application, that will be based on the spirit of adopting a dog.
0:09:06 Java Version Discussion: The speaker emphasizes the importance of using Java 21 or later due to its technical and moral superiority, noting that Java 24 is on the horizon.
0:10:58 Project Setup: The speaker creates a Spring Boot application using start.spring.io, choosing Java 21, Maven and including dependencies like Spring Web, Data JDBC, PGVector, Spring AI, Spring Modulith, and GraalVM Native Image support.
0:13:33 Key Java 21 Features: Josh highlights the benefits of data-oriented programming in Java 21, supported by records, sealed types, pattern matching, and smart switch expressions.
0:17:18 Basic Spring Concepts: The speaker revisits basic Spring concepts, such as dependency injection and the bean lifecycle.
0:20:28 Spring Modulith: Discussion about code modularity and the role of Spring Modulith for limiting the blast radius of change and promoting social and political velocity.
0:27:59 Spring Boot Auto-Configuration: Spring Boot ships with an element called auto configuration, a mechanism by which spring boot discovers java configuration classes when it first starts up and tries to run all of these.
0:31:38 Dog Adoption API: He creates a simple REST endpoint using Spring Web to adopt a dog.
0:47:01 Event-Driven Architecture: The video dives into different uses of Event-Driven Architecture including event notification, event carried state transfer and event sourcing, as presented by Martin Fowler.
1:01:34 Spring Modulith Eventing: The speaker then implements Spring Modulith eventing for asynchronous processing of a veterinarian checkup using @ApplicationModuleListener and event republishing for reliability, guaranteed with EventPublication table.
1:12:00 Spring Framework History: A quick discussion about all of Spring's history including the release of Spring Boot 1.0.
1:12:52 Spring Cloud and Kubernetes: Quick discussion about Spring Cloud and Kubernetes including Spring Cloud Skipper, Spring Cloud Gateway and more.
1:13:45 Code Modularity Enforcement: The speaker also demonstrates how to use spring modulith to test modularity by using an application modules and verify that components from one module are not exposed to another module.
1:20:00 AI Integration: The speaker integrates Spring AI to build an AI-powered assistant into the dog adoption application.
1:20:50 Model and Privacy Discussion: The host discusses Alama, models on privacy and running them locally. The host also mentions the need to be polite to LLMβs.
1:22:52 AI Context Prompting: The host uses an LLM and a system prompt that configures it to act as a pet assistant at a pet adoption agency named Pooch Palace.
1:31:14 Business Logic Integration: The speaker stresses the importance of AI engineering through the integration of business logic with AI models, noting Java's strong capabilities in this area.
1:34:32 Token Metrics: Important that teams monitor Token metrics and manage token costs with tooling built into Micrometer and Spring AI.
1:35:18 Vector Stores: He uses a PGVector, a plug in used for Vector stores to take existing data (documents) and store them for later so they are not always needing to be fed into the context window.
1:35:26 Embedding Models: Vector stores work behind the scenes using embedding models which turn existing data and information into a matrix of numbers. These create Vector spaces, that represent relevant data, and should always consistently use the same model.
1:44:40 gRPC (g, double underscore, RPC) (again): The host stresses there are better options but the talk was set up to show gRPC.
1:44:56 Security and OAuth 2.0: The talk covers the implementation and securing of Spring Security and oAuth 2.0 to lock down and protect microservices from unwanted entry.
1:45:07 OAuth 2.0 Clients: The host explains the importance of OAuth 2.0 clients in front of your API and also explains the usefulness of the Spring Authorization Server.
1:58:08 Spring Cloud Gateway: Demonstration with Spring Cloud Gateway and how it provides load balancing with a reactive HTTP Client.
2:08:48 Java Efficiency: After the implementation is done and ready for production, the host explores Java 21 efficiency with virtual threads and shares insights on programming languages that use the least amount of electricity.
2:38:02 Code Scalability with GraalVM Native Images: The speaker then showcases the potential benefits of using GraalVM Native Images for faster startup times and reduced memory footprint.
2:45:53 Conclusion: A quick recap of everything that was discussed and implemented in the talk.