Book Image

Distributed Computing in Java 9

Book Image

Distributed Computing in Java 9

Overview of this book

Distributed computing is the concept with which a bigger computation process is accomplished by splitting it into multiple smaller logical activities and performed by diverse systems, resulting in maximized performance in lower infrastructure investment. This book will teach you how to improve the performance of traditional applications through the usage of parallelism and optimized resource utilization in Java 9. After a brief introduction to the fundamentals of distributed and parallel computing, the book moves on to explain different ways of communicating with remote systems/objects in a distributed architecture. You will learn about asynchronous messaging with enterprise integration and related patterns, and how to handle large amount of data using HPC and implement distributed computing for databases. Moving on, it explains how to deploy distributed applications on different cloud platforms and self-contained application development. You will also learn about big data technologies and understand how they contribute to distributed computing. The book concludes with the detailed coverage of testing, debugging, troubleshooting, and security aspects of distributed applications so the programs you build are robust, efficient, and secure.
Table of Contents (17 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Customer Feedback
2
Communication between Distributed Applications
3
RMI, CORBA, and JavaSpaces

Preface

Distributed computing is a way of improving the system processing ability by splitting and sharing the effort with multiple smaller systems and collating the results from them to get the desired process output. In this book, we have tried our best to put together the concepts of distributed computing, from the thought they started and how trends have changed from single-computer processing to modern distributed computing on cloud portfolio. While we describe each of the concepts with detailed explanations and handy diagrams that rightly represent the systems and flows, we bring appropriate examples and code snippets to help you understand how they can be implemented with the help of Java 9. There are numerous improvements to the concepts, and additional features have enriched Java's ability to support distributed computing in Java 9. We have discussed the era of distributed computing along with latest improvements and application in Java 9 through the separate chapters. This should cover the design thoughts and security aspects as well, which, we believe, lets you concentrate on that specific topic and understand it a step further with the right combination of explanation, diagrams, and code snippets. This book took about 6 months for me to write, and it was a great journey. The design and development experiences with multiple enterprise integrations and distributed systems with the support of solution architecture teams helped me go through the on-ground challenges and improve the design standpoint of system integration. You will see in multiple places that I start talking about design perspectives and patterns before the solution implementation specifics. Also, care has been taken to help you with the concepts in such a way that you should feel like being part of a detailed technical conversation right from the start, where your knowledge and past skillset help you go through them and improve along the depth of the chapters. Most concepts are imbued with an everlasting perception of reusability and thorough engineering, and I believe some parts of this will remain with you, being the reader, as useful techniques to reuse in your application development. Finally, while I have made sure to complement every chapter with several images to illustrate the desired output, I think it is paramount for you to review every concept along with practice, which helps you learn and build confidence in working with such systems. Have fun building great things!

What this book covers

Chapter 1, Quick Start to Distributed Computing, reviews the basic concepts of distributed and parallel computing, what it is, why it is required, and how Java supports distributed computing, along with their architecture.

Chapter 2, Communication between Distributed Applications, covers different ways of communicating with remote systems in a distributed architecture, the concept of sockets, and stream programming with examples and URL-based communication.

Chapter 3, RMI, CORBA, and JavaSpace, teaches what the components of message-based systems are and how architectures such as RMI, CORBA, and Java Spaces complement it.

Chapter 4, Enterprise Messaging, explores the concept of enterprise integration patterns and the concepts of synchronous and asynchronous messaging, with technologies such as JMS and web services.

Chapter 5, HPC Cluster Computing, covers handling large amounts of data through parallel or distributed computing using HPC, cluster-computing architecture, and Java support for these implementations.

Chapter 6, Distributed Databases, covers the concepts and ways to set up a distributed database. It also explains how distributed databases help in performance improvisation with distributed transactions and XA transactions with examples.

Chapter 7, Cloud and Distributed Computing, explains how cloud and distributed computing go hand in hand. You will also learn the setup and procedure to configure your applications on market-leading cloud environments.

Chapter 8, Big Data Analytics, discusses big data concepts and how big data helps in distributed computing. The chapter covers the implementations of big data, along with methods and applications, including Hadoop, MapReduce, and HDFS.

Chapter 9, Testing, Debugging, and Troubleshooting, explores how to test, debug, and troubleshoot distributed systems, and the different challenges in distributed computing.

Chapter 10, Security, discusses different security issues and constraints associated with distributed computing and how to address them.

What you need for this book

To follow along with this book, you'll need a computer with an internet connection. You can choose to work online on the Cloud Java IDE to practice the examples. I recommend you have the Eclipse IDE with Tomcat/WebLogic container with the respective respective Maven/Gradle dependencies based on the concept you want to practice happily. For concepts such as cloud computing, you should have access to Cloud Foundry to practice.

Who this book is for

This book has been tested on people who have decent programming knowledge of Java. They picked up going through the chapters with practice, and in the end, they had a thorough knowledge of distributed computing and the design aspects of distributed computing. In this book, you will learn some tricks and tips that you probably didn't know about, or some wise suggestions that will help you along the way. This book, if followed from cover to cover, will turn you into a proficient distributed system architecture expert. On the other hand, if you already are, it provides a good reference for many different features and techniques that may come in handy from time to time. Finally, this book is also a valid migration guide if you have already experimented with distributed system concepts and you feel overwhelmed by change.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning. Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts using the include directive." A block of code is set as follows:

[default]
public static void main(String[] args) { 
  System.out.println(“Distributed computing with Java 9”);       
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

[default]
public static void main(String[] args) {
//Comments for the below statement System.out.println(“Distributed 
  //computing with Java 9”);   
}

Any command-line input or output is written as follows:

# cp /usr/src/main/java/distributed/target/Component.class 
     /etc/distributed/classes/Component.class

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In order to download new modules, we will go to Files | Settings | Project Name | Project Interpreter."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Distributed-Computing-in-Java-9. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title. To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at [email protected] with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.