O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Distributed Computing in Java 9

Book Description

Explore the power of distributed computing to write concurrent, scalable applications in Java

About This Book

  • Make the best of Java 9 features to write succinct code
  • Handle large amounts of data using HPC
  • Make use of AWS and Google App Engine along with Java to establish a powerful remote computation system

Who This Book Is For

This book is for basic to intermediate level Java developers who is aware of object-oriented programming and Java basic concepts.

What You Will Learn

  • Understand the basic concepts of parallel and distributed computing/programming
  • Achieve performance improvement using parallel processing, multithreading, concurrency, memory sharing, and hpc cluster computing
  • Get an in-depth understanding of Enterprise Messaging concepts with Java Messaging Service and Web Services in the context of Enterprise Integration Patterns
  • Work with Distributed Database technologies
  • Understand how to develop and deploy a distributed application on different cloud platforms including Amazon Web Service and Docker CaaS Concepts
  • Explore big data technologies
  • Effectively test and debug distributed systems
  • Gain thorough knowledge of security standards for distributed applications including two-way Secure Socket Layer

In Detail

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.

Style and approach

This is a step-by-step practical guide with real-world examples.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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 code file.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Errata
      3. Piracy
      4. Questions
  2. Quick Start to Distributed Computing
    1. Parallel computing
      1. Amdahl's law
    2. Distributed computing
    3. Parallel versus distributed computing
    4. Design considerations for distributed systems
      1. Java support
    5. Summary
  3. Communication between Distributed Applications
    1. Client-server communication
      1. Sockets and streams
      2. Socket programming for TCP
        1. Reading from the socket
      3. Socket programming for UDP
        1. Multicasting
      4. Streams
      5. URLs, URLConnections, and the ContentHandler classes
        1. URL (base URL and relative URL)
        2. Practicality of URLs
        3. ClassLoader
      6. Summary
  4. RMI, CORBA, and JavaSpaces
    1. RMI
      1. What is RMI?
        1. Key terminologies of RMI
        2. RMI for distributed computing
      2. Writing an RMI server
        1. Implementing a remote interface
        2. Creating a client program
        3. Compiling programs
          1. Building a JAR file from the interface classes
          2. Building the server classes
          3. Building the client classes
        4. Running a remote client program
        5. Starting the server
        6. Invoking the client
      3. Common Object Request Broker Architecture (CORBA)
        1. CORBA standards
        2. Inter-ORB communication
        3. Java support for CORBA
        4. OMG IDL samples
          1. Interfaces
          2. Inheritance
          3. Types and constants
          4. Structures
          5. Discriminated unions
          6. Sequences
        5. CORBA services
        6. Sample CORBA program using JAVA IDL
          1. IDL interface specification
          2. Compiling the IDL
          3. Client application
          4. Object implementation
          5. Defining the server
          6. Compiling and starting the server
          7. Executing the client
    2. JavaSpaces
      1. Overview
      2. How it works
      3. Sample JavaSpaces code
        1. How Java 9 adds value
      4. Summary
  5. Enterprise Messaging
    1. EMS
    2. JMS
      1. The publish/subscribe messaging paradigm
      2. The Point-To-Point Messaging Paradigm
      3. JMS interfaces
      4. Developing a JMS application
      5. Publish-Subscribe (topic) programming
      6. Point-To-Point (queue) programming
    3. Web services
      1. Web service architectures
      2. SOAP web services
      3. RESTful web services
      4. Building a SOAP web service using the JAX-WS API in RPC Style
      5. Building SOAP web service using the JAX-WS API in Document style
      6. Building a RESTful web service using the JAX-RS API (using the Jersey implementation)
    4. Enterprise integration patterns
      1. Summary
  6. HPC Cluster Computing
    1. Era of computing
    2. Commanding parallel system architectures
      1. MPP
      2. SMP
      3. CC-NUMA
      4. Distributed systems
      5. Clusters
      6. Network of workstations
      7. Cluster computer architecture
      8. Cluster system software and tools
      9. HPCC
    3. Java support for high-performance computing
    4. Java support for parallel programming models
      1. Multithreading
      2. Parallelism
      3. Synchronization
      4. JOMP
      5. Java message passing
      6. The Spliterator interface
      7. Parallel stream processing
    5. Java 9 updates for processing an API
    6. Summary
  7. Distributed Databases
    1. Distributed and decentralized databases
      1. Motivation for distributed databases
    2. Distributed database environments
      1. Homogeneous distributed database environment
      2. Heterogeneous distributed database environment
    3. Distributed database setup methodologies
      1. Replication
      2. Horizontal partitioning
      3. Vertical partitioning
      4. Hybrid setup
    4. Distributed DBMS architecture
    5. Java Database Connectivity
      1. JTA for distributed transactions
      2. Switching between the transaction modes
        1. Sample program for the XA transaction
    6. Summary
  8. Cloud and Distributed Computing
    1. What is cloud computing?
      1. Cloud deployment models
      2. Cloud computing patterns
    2. Features of cloud computing
    3. Cloud versus distributed computing
    4. Cloud service providers
    5. AWS
      1. Amazon EC2
      2. Amazon S3
      3. Amazon SQS
      4. Amazon CloudFront
      5. Amazon SimpleDB
      6. Writing a distributed application on AWS
    6. Docker CaaS
    7. CaaS
      1. Characteristics of Docker CaaS
      2. Docker CaaS platform components
        1. Eclipse integration for a Docker container
      3. Deploying a sample Java application to Tomcat with Docker
    8. Java 9 support
      1. Spring Boot
      2. Spring Cloud
      3. Spring Cloud Data Flow
    9. Summary
  9. Big Data Analytics
    1. What is big data?
    2. Big data characteristics
      1. Volume
      2. Variety
      3. Velocity
      4. Veracity
    3. NoSQL databases
    4. Hadoop, MapReduce, and HDFS
      1. Hadoop
        1. HDFS (Hadoop Distributed File System)
        2. MapReduce
        3. Cloud computing for Hadoop
        4. Dynamic Distributed Dimensional Data Model (D4M)
    5. Distributed computing for big data
    6. ZooKeeper for distributed computing
    7. Summary
  10. Testing, Debugging, and Troubleshooting
    1. Challenges in testing distributed applications
    2. Standard testing approach in software systems
      1. Unit testing
        1. Mocking the dependencies
        2. Continuous Integration (CI)-based unit testing
      2. System testing
        1. System integration testing
      3. User Acceptance Testing
    3. Cloud distributed application testing
    4. Latest tools for testing Java distributed applications
      1. JUnit
      2. JTest
      3. TestNG
      4. Arquillian
      5. The Grinder
      6. JWalk
      7. Mockito
      8. PowerMock
    5. Debugging and troubleshooting distributed applications
    6. Summary
  11. Security
    1. Security issues and concerns
    2. Two-way Secure Sockets Layer (SSL) implementation
      1. Two-way SSL implementation for web services
        1. Allow the secured calls in server application
        2. Generate a client program as a web service client with a two-way SSL
    3. Cloud computing security
    4. Security enhancements in Java 9
      1. Datagram Transport Layer Security
      2. TLS Application Layer Protocol Negotiation Extension
        1. OCSP stapling for TLS
    5. Summary