Example: tourism industry

Microservices Best Practices for Java

RedbooksFront coverMicroservices best Practices for JavaMichael HofmannErin SchnabelKatherine StanleyInternational Technical Support OrganizationMicroservices best Practices for JavaDecember 2016SG24-8357-00 Copyright International Business Machines Corporation 2016. All rights to Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Edition (December 2016)This edition applies to WebSphere Application Server Liberty : Before using this information and the product it supports, read the information in Notices on page vii. Copyright IBM Corp. 2016. All rights .. viiTrademarks .. viiiPreface .. ixAuthors .. ixNow you can become a published author, too! .. xiComments welcome.. xiStay connected to IBM Redbooks .. xiChapter 1. Overview .. Cloud native applications .. Twelve factors.

International Technical Support Organization Microservices Best Practices for Java December 2016 SG24-8357-00

Tags:

  Practices, Best, Java, Microservices, Microservices best practices for java

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Microservices Best Practices for Java

1 RedbooksFront coverMicroservices best Practices for JavaMichael HofmannErin SchnabelKatherine StanleyInternational Technical Support OrganizationMicroservices best Practices for JavaDecember 2016SG24-8357-00 Copyright International Business Machines Corporation 2016. All rights to Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Edition (December 2016)This edition applies to WebSphere Application Server Liberty : Before using this information and the product it supports, read the information in Notices on page vii. Copyright IBM Corp. 2016. All rights .. viiTrademarks .. viiiPreface .. ixAuthors .. ixNow you can become a published author, too! .. xiComments welcome.. xiStay connected to IBM Redbooks .. xiChapter 1. Overview .. Cloud native applications .. Twelve factors.

2 Microservices .. The meaning of small .. Independence and autonomy .. Resilience and Fault tolerance .. Automated environment .. Philosophy and team structure .. Examples .. Online retail store .. Game On! .. 8 Chapter 2. Creating Microservices in java .. java platforms and programming models .. Spring Boot .. Dropwizard .. java Platform, Enterprise Edition .. Versioned dependencies.. Identifying services .. Applying domain-driven design principles.. Translating domain elements into services .. Application and service structure .. Shared library or new service? .. Creating REST APIs .. Top down or bottom up? .. Documenting APIs .. Use the correct HTTP verb .. Create machine-friendly, descriptive results .. Resource URIs and versioning .. 20 Chapter 3. Locating services.. Service registry.

3 Third-party registration versus self-registration.. Availability versus consistency .. Service invocation .. Server side .. Client side .. API Gateway .. 32iv Microservices best Practices for JavaChapter 4. Microservice communication .. Synchronous and asynchronous .. Synchronous messaging (REST) .. Asynchronous messaging (events) .. Examples .. Fault tolerance .. Resilient against change .. Timeouts .. Circuit breakers .. Bulkheads .. 39 Chapter 5. Handling data .. Data-specific characteristics of a microservice .. Domain-driven design leads to entities .. Separate data store per microservice .. Polyglot persistence .. Data sharing across Microservices .. Event Sourcing and Command Query Responsibility Segregation.. Messaging systems .. Distributed transactions .. Support in java .

4 java Persistence API .. Enterprise JavaBeans .. BeanValidation .. Contexts and Dependency Injection .. java Message Service API .. java and other messaging protocols .. 65 Chapter 6. Application Security.. Securing microservice architectures .. Network segmentation .. Ensuring data privacy .. Automation .. Identity and Trust .. Authentication and authorization.. Delegated Authorization with OAuth .. JSON Web Tokens .. Hash-Based Messaging Authentication Code.. API keys and shared secrets .. 76 Chapter 7. Testing.. Types of tests .. Application architecture .. Single service testing .. Testing domain or business function.. Testing resources .. Testing external service requests .. Testing data requests .. Component testing .. Security verification .. Staging environment.

5 Test data .. Integration .. Contract .. 86 Contents End-to-end .. Fault tolerance and resilience .. Production environment .. Synthetic monitoring .. Canary testing .. 88 Chapter 8. From development to production .. Deployment patterns .. Deployment pipelines and tools .. Packaging options .. JAR, WAR, and EAR file deployment on preinstalled middleware .. Executable JAR file .. Containerization .. Every microservice on its own server .. Aspects of running multiple Microservices on one server .. Preferred Practices on packaging .. Configuration of the applications across stages .. Environment variables .. Configuration files .. Configuration systems .. Programming considerations .. Preferred Practices on configuration .. 105 Chapter 9. Management and Operations .. Metrics and health checks.

6 Dynamic provisioning .. Health check .. Logging .. Templating .. 113 Related publications .. 115 IBM Redbooks .. 115 Other publications .. 115 Online resources .. 115 Help from IBM .. 116vi Microservices best Practices for java Copyright IBM Corp. 2016. All rights information was developed for products and services offered in the US. This material might be available from IBM in other languages. However, you may be required to own a copy of the product or product version in that language in order to access it. IBM may not offer the products, services, or features discussed in this document in other countries. Consult your local IBM representative for information on the products and services currently available in your area. Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM product, program, or service may be used.

7 Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property right may be used instead. However, it is the user s responsibility to evaluate and verify the operation of any non-IBM product, program, or service. IBM may have patents or pending patent applications covering subject matter described in this document. The furnishing of this document does not grant you any license to these patents. You can send license inquiries, in writing, to:IBM Director of Licensing, IBM Corporation, North Castle Drive, MD-NC119, Armonk, NY 10504-1785, US INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some jurisdictions do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.

8 This information could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time without notice. Any references in this information to non-IBM websites are provided for convenience only and do not in any manner serve as an endorsement of those websites. The materials at those websites are not part of the materials for this IBM product and use of those websites is at your own risk. IBM may use or distribute any of the information you provide in any way it believes appropriate without incurring any obligation to you. The performance data and client examples cited are presented for illustrative purposes only. Actual performance results may vary depending on specific configurations and operating conditions.

9 Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. Statements regarding IBM s future direction or intent are subject to change or withdrawal without notice, and represent goals and objectives only. This information contains examples of data and reports used in daily business operations. To illustrate them as completely as possible, the examples include the names of individuals, companies, brands, and products. All of these names are fictitious and any similarity to actual people or business enterprises is entirely coincidental. COPYRIGHT LICENSE:This information contains sample application programs in source language, which illustrate programming techniques on various operating platforms.

10 You may copy, modify, and distribute these sample programs in any form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs conforming to the application programming interface for the operating platform for which the sample programs are written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. The sample programs are provided AS IS , without warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample programs. viii Microservices best Practices for JavaTrademarksIBM, the IBM logo, and are trademarks or registered trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies.


Related search queries