Malhotra | Rapid Java Persistence and Microservices | E-Book | www2.sack.de
E-Book

E-Book, Englisch, 322 Seiten

Malhotra Rapid Java Persistence and Microservices

Persistence Made Easy Using Java EE8, JPA and Spring
1. ed
ISBN: 978-1-4842-4476-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark

Persistence Made Easy Using Java EE8, JPA and Spring

E-Book, Englisch, 322 Seiten

ISBN: 978-1-4842-4476-0
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark



Gain all the essentials you need to create scalable microservices, which will help you solve real challenges when deploying services into production. This book will take you through creating a scalable data layer with polygot persistence. You'll cover data access and query patterns in Spring and JPA in high-performance environments. As part of this topic, you'll see the advantages of multiple persistence frameworks in Java and especially the easy persistence offered by NoSQL databases and reactive web solutions. 
The last few chapters present advanced concepts that are useful for very high-performance real-time applications: you'll implement applications using Spring's good support for Web sockets in their raw form as well as for connecting to message brokers such as RabbitMQ. This can be useful for applications such as navigation systems and gaming platforms.

What You Will LearnBuild end-to-end modern applications using microservices, persistence essentials, reactive web, and other high-performance concepts 
Master Spring's configuration options
Secure microservices efficiently 
Monitor your services post deployment 
Who This Book Is For 

Java developers and architects interested in microservices. 


Raj Malhotra is a passionate, hands on experienced leader with a proven track record. With proven experience in architecting large-scale software systems with complex performance and availability requirements, he has delivered innovative products and solutions across various domains. He has worked with startups and enterprises as well as with service-based companies. He has built systems capable of handling millions of operations/sec with complex workflows.

Malhotra Rapid Java Persistence and Microservices jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


1;Table of Contents;5
2;About the Author;12
3;About the Technical Reviewer;13
4;Acknowledgments;14
5;Part I: Java Ecosystem Review and Persistence Quick Start;15
5.1;Chapter 1: Introduction;16
5.1.1;Why Java and Why This Book;17
5.1.2;Current Issues with the Java Ecosystem;18
5.1.3;Real-World Problems and Solutions;19
5.1.4;Summary;20
5.2;Chapter 2: Developing Microservices with Java;21
5.2.1;Different Ways of Creating Microservices;22
5.2.2;Various Microservices Libraries in Java;22
5.2.3;Microservices with Various Java Frameworks;24
5.2.3.1;Spark Framework;25
5.2.3.2;Dropwizard;27
5.2.3.2.1;Gradle Project;28
5.2.3.2.2;Configuration Class;29
5.2.3.2.3;Model Class;30
5.2.3.2.4;Resource Class;30
5.2.3.2.5;Application Class;31
5.2.3.2.6;YAML File: Application.yml;32
5.2.3.2.7;Running the Application;33
5.2.3.3;Spring Boot;34
5.2.4;Summary;37
5.3;Chapter 3: Basic Persistence with Spring;38
5.3.1;Spring Data JPA Introduction;39
5.3.2;Spring Data JPA Example;42
5.3.2.1;The @OnetoMany and @ManyToone Annotations;43
5.3.2.1.1;Creating the Blog App;44
5.3.2.1.2;Application Setup;45
5.3.2.1.3;Enums as Datatypes in Postgresql and Mapping in JPA;49
5.3.2.1.4;Data Models and Repositories;53
5.3.2.2;Using CascadeType.ALL and What to Avoid;60
5.3.2.3;An @ManyToMany Example;69
5.3.2.4;Running the Application;73
5.3.2.5;The @OneToOne Annotation;74
5.3.2.6;Handling Array Types in PostgreSQL;76
5.3.2.7;JPQL Queries and Pagination with Spring Data JPA;79
5.3.2.8;Using a Common Base Repository;80
5.3.3;Summary;82
6;Part II: Solving Advanced Persistence Problems and Microservices Communication Challenges;83
6.1;Chapter 4: Common Use Cases with JPA;84
6.1.1;Multi-Datasource Interaction;86
6.1.1.1;Application Setup;86
6.1.1.2;Datasource Configuration;87
6.1.1.3;Data Models and Repositories;92
6.1.1.4;Service Definitions;95
6.1.1.5;Application Configuration;98
6.1.1.6;Application Class;99
6.1.1.7;Running the Application;101
6.1.2;Solving the N+1 Problem;102
6.1.2.1;Fetching by Using the Left Fetch Join Clause in JPQL;102
6.1.2.1.1;Running the Eshop Application Again;104
6.1.2.2;Fetching the User Objects First and Then Fetching the Post Objects for These Users Separately;105
6.1.2.3;Fetching as a Single Combined Result Mapped to DTOS with a Native Query;105
6.1.3;JPA Querying with Constructor Mapping;105
6.1.3.1;Running the Eshop Application Again for the Constructor Mapping Use Case;107
6.1.4;JPA Querying with Mapping to Projections;107
6.1.4.1;Running the Eshop Application Again for the Projections Use Case;110
6.1.5;Spring Converter Service;111
6.1.6;Important JPA Concepts;114
6.1.6.1;JPA Managed Entity and Its Lifecycle;114
6.1.6.2;Isolation Levels, Locking, and Performance;116
6.1.6.2.1;Data Read Phenomena;116
6.1.6.2.2;Isolation Levels;117
6.1.6.3;Interesting JPA Properties;119
6.1.6.4;Running the Eshop Application for the JPA Properties;119
6.1.7;Summary;123
6.2;Chapter 5: Java Persistence Without ORMs;124
6.2.1;Spring JDBC Template;125
6.2.1.1;Application Setup;126
6.2.1.2;Configuration and Initial Schema Script;127
6.2.1.3;DTO and Application Class;128
6.2.1.4;Test Case;129
6.2.1.5;Running the Eshop-JDBC-Template-ch5 Application Test Case;131
6.2.2;Spring Data JDBC;132
6.2.2.1;Application Setup;134
6.2.2.2;Configuration and Initial Schema Script;134
6.2.2.3;Domain Models and Application Class;135
6.2.2.4;Data Repository;138
6.2.2.5;The Controller Class;139
6.2.2.6;Running the Eblog-Spring-Data-JDBC-ch5 Application Test Case;140
6.2.3;Spring Data for NoSQLs;141
6.2.3.1;Application Setup;142
6.2.3.2;Data Models;143
6.2.3.3;Data Repositories;145
6.2.3.4;Bootstrapping;145
6.2.3.5;Test Case;146
6.2.3.6;Running the Blog-Spring-Data-Mongodb-ch5 Application Test Case;148
6.2.3.7;Additional Features;149
6.2.4;Summary;149
6.3;Chapter 6: Deep Dive Into Microservices Development with Java;150
6.3.1;Interservice Communication;152
6.3.2;Configuration Management;153
6.3.2.1;Application Setup;155
6.3.2.2;Configuration;156
6.3.2.2.1;Configuration Files;156
6.3.2.2.2;Git Repository Setup;157
6.3.2.3;Bootstrapping;158
6.3.2.4;Running the Config-Service Application;159
6.3.3;Service Discovery in the Microservices Architecture;161
6.3.3.1;Discovery Service Application;162
6.3.3.1.1;Application Setup;163
6.3.3.1.2;Configuration;164
6.3.3.1.3;Bootstrapping;165
6.3.3.1.4;Running the Discovery-Service Application;166
6.3.3.2;Inventory Service Application;167
6.3.3.2.1;Application Setup;168
6.3.3.2.2;Configuration;168
6.3.3.2.3;Full Application Code;170
6.3.3.2.4;Running the Inventory-Service Application;174
6.3.3.3;Eshop Application;176
6.3.3.3.1;Application Setup;178
6.3.3.3.2;Configuration;180
6.3.3.3.3;Data Model, Repository and Controller Class;181
6.3.3.3.4;Service Classes;185
6.3.3.3.5;Order Service Implementation Using the Eureka Client;186
6.3.3.3.5.1;Running the Eshop Application;190
6.3.3.3.5.2;Discovery Service Dashboard;192
6.3.3.3.6;Order Service Implementation Using Feign;193
6.3.4;Resiliency in the Microservices Architecture;195
6.3.4.1;Checking Hystrix;197
6.3.5;Request Tracing in the Microservices Architecture;200
6.3.6;Monitoring in the Microservices Architecture;203
6.3.6.1;Application Setup;205
6.3.6.2;Configuration;206
6.3.6.3;Application Class;207
6.3.6.4;Admin Service Client;207
6.3.6.5;Testing the Admin Service;208
6.3.7;Rapid-Fire Documentation;210
6.3.7.1;Java Configuration;210
6.3.7.2;Customizing Swagger;212
6.3.8;API Gateway;215
6.3.8.1;Application Setup;216
6.3.8.2;Configuration;217
6.3.8.3;Bootstrapping;218
6.3.8.4;Filters;218
6.3.8.5;Running the Application;220
6.3.9;Code Reuse Across Services;221
6.3.10;Microservices Security;222
6.3.10.1;Eshop Service Changes;223
6.3.10.1.1;Login Controller;223
6.3.10.1.2;Testing Token Generation;225
6.3.10.2;Gateway-Service Changes;226
6.3.10.2.1;Testing Gateway Authentication;228
6.3.11;Summary;229
7;Part III: Making HTTP Faster;230
7.1;Chapter 7: Java GraphQL Development;231
7.1.1;Important Concepts;231
7.1.2;How It Works;232
7.1.3;Advantages Over REST;233
7.1.4;Risks and Disadvantages;237
7.1.5;GraphQL Java Example;238
7.1.5.1;Application Setup;240
7.1.5.2;Schema File: Resources/Schema.Graphqls;241
7.1.5.3;Data Models and Repositories;243
7.1.5.4;Input DTOs;245
7.1.5.5;Query and Mutation Classes;246
7.1.5.6;Configuration;251
7.1.6;Running the eblog-graphql-ch7 Application;252
7.1.7;Summary;257
7.2;Chapter 8: Java Reactive Development;258
7.2.1;The Reactive Manifesto;258
7.2.2;The Reactive Streams Project;259
7.2.3;The RxJava (Reactive Extensions) Project;261
7.2.4;Reactive APIs Within Core Java;262
7.2.5;Reactor and Spring Reactive;262
7.2.6;The Reactive Blog Microservice (Built On Spring Reactive);264
7.2.6.1;Application Setup;264
7.2.6.2;Configuration;266
7.2.6.3;Model Class and Repository Definition;267
7.2.6.4;DTO and Web Controller;268
7.2.6.5;Bootstrapping;270
7.2.6.6;Output;271
7.2.6.7;Sample Client;272
7.2.7;Summary;272
7.3;Chapter 9: Java Websockets Development;273
7.3.1;Application Setup;274
7.3.2;Bootstrapping;275
7.3.3;Tweet Handler;276
7.3.4;Message Service;277
7.3.5;Tweet Controller;279
7.3.6;Running the Websocket-Example-Ch9 Application;280
7.3.7;Summary;283
7.4;Chapter 10: Java Serverless Development;284
7.4.1;Application Setup;286
7.4.2;Functional Code;287
7.4.3;Running the Serverless-Example-Ch10 Application;288
7.4.4;Summary;289
7.5;Chapter 11: Java Messaging;290
7.5.1;RabbitMQ;291
7.5.1.1;Application Setup;292
7.5.1.2;Bootstrapping;293
7.5.1.3;RabbitMQ Configuration;293
7.5.1.4;Message Producer;295
7.5.1.5;Message Consumer;296
7.5.1.6;Running the Application;297
7.5.2;Apache Kafka;301
7.5.2.1;Kafka Tools and Build Script;301
7.5.2.2;Message Producer;302
7.5.2.3;Message Consumer;304
7.5.2.4;Running the Application Again;304
7.5.3;Summary;310
7.6;Chapter 12: Java Language and Ecosystem Recap;311
7.6.1;Improvements to Concurrent APIs;311
7.6.1.1;Basics;311
7.6.1.2;Features After Java 5;312
7.6.1.3;After Java 5;312
7.6.1.4;The Future;313
7.6.2;Other Improvements;313
7.6.3;Tools and Tips for Productivity;315
7.6.4;Summary;315
8;Index;316



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.