万本电子书0元读

万本电子书0元读

顶部广告

Learning Apache Thrift电子书

售       价:¥

34人正在读 | 0人评论 9.8

作       者:Krzysztof Rakowski

出  版  社:Packt Publishing

出版时间:2015-12-30

字       数:186.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Make applications cross-communicate using Apache Thrift! About This Book Leverage Apache Thrift to enable applications written in different programming languages (Java, C++, Python, PHP, Ruby, and so on) to cross-communicate. Learn to make your services ready for real-world applications by using stepwise examples and modifying code from Industry giants. Be a crackerjack at solving Apache Thrift-related issues. Who This Book Is For If you have some experience of developing applications in one or more languages supported by Apache Thrift (C++, Java, PHP, Python, Ruby, and others) and want to broaden your knowledge and skills in building cross-platform, scalable applications, then this book is for you. What You Will Learn Understand the need for cross-language services and the basics of Apache Thrift. Learn how Apache Thrift works and what problems it solves. Determine when to use Apache Thrift instead of other methods (REST API), and when not to use it. Create and run an example application using Apache Thrift. Use Apache Thrift in your applications written in different languages supported by Apache Thrift (PHP, Python, Ruby, Java, and C++). Handle exceptions and deal with errors. Modify code in different languages.< Use Apache Thrift in the production environments of big applications. In Detail With modern software systems being increasingly complex, providing a scalable communication architecture for applications in different languages is tedious. The Apache Thrift framework is the solution to this problem! It helps build efficient and easy-to-maintain services and offers a plethora of options matching your application type by supporting several popular programming languages, including C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml, and Delphi. This book will help you set aside the basics of service-oriented systems through your first Apache Thrift-powered app. Then, progressing to more complex examples, it will provide you with tips for running large-scale applications in production environments. You will learn how to assess when Apache Thrift is the best tool to be used. To start with, you will run a simple example application, learning the framework's structure along the way; you will quickly advance to more complex systems that will help you solve various real-life problems. Moreover, you will be able to add a communication layer to every application written in one of the popular programming languages, with support for various data types and error handling. Further, you will learn how pre-eminent companies use Apache Thrift in their popular applications. This book is a great starting point if you want to use one of the best tools available to develop cross-language applications in service-oriented architectures. Style and approach A stepwise guide to learning Apache Thrift, with ready-to-run examples explained comprehensively. Advanced topics supply the inspiration for further work.
目录展开

Learning Apache Thrift

Table of Contents

Learning Apache Thrift

Credits

About the Author

About the Reviewer

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Introducing Apache Thrift

Distributed systems and their services

Service-oriented architecture

Distributed systems

Maintainability

Scalability

Testability

An introduction to Apache Thrift

Supported programming languages

Data types

Transports

Protocols

Versioning

Security

Interface description language

Apache Thrift and others

Custom protocols

XML-RPC and JSON-RPC

SOAP and WSDL

RESTful APIs

CORBA

Apache Avro

Protocol Buffers

When to choose Apache Thrift

Summary

2. Installing and Running Apache Thrift

Installing Apache Thrift on Linux

Installation requirements

Installing dependencies

Installing dependencies on CentOS

Installing dependencies on Debian and Ubuntu

Installing Apache Thrift

Installing Apache Thrift on Mac OS X

Installing Apache Thrift

Installing Apache Thrift on Windows

Testing the installation

Summary

3. Running Your First Apache Thrift Service and Client

Creating necessary project files

Creating a local copy of the Apache Thrift libraries

Defining our first service and generating files

The service code in PHP

The client code in Python

Running the code

What really happened?

Analyzing the code

The service description – IDL

The server script – PHP

The client script – Python

Summary

4. Understanding How Apache Thrift Works

Prepare your tools

Apache Thrift's architecture

Going about using the tool

Designing the services

Preparing the interface description

Generating service and client libraries

Implementing services and clients

Running server and clients

The network stack

Transport

Protocol

Processor

Server and client

Example

Apache Thrift's type system

Basic types

Special types

Structs

Unions

Containers

list

set

map

Usage of containers

Enums

Exceptions

Services

IDL syntax

Comments

Document

Headers

Thrift include

C++ include

Namespace

Definitions

const

typedef

Summary

5. Generating and Running Code in Different Languages

PHP

Generating the code

Examining the code

Transports

Protocols

Servers

Implementing and running the service

Implementing and running the client

Java

Generating the code

Examining the code

Transports

Protocols

Servers

Implementing and running the service

Implementing and running the client

Python

Generating the code

Examining the code

Transports

Protocols

Servers

Building the libraries

Implementing and running the service

Implementing and running the client

JavaScript

Generating the code

Examining the code

Transport, protocol, and servers

Implementing and running the client

Ruby

Generating the code

Examining the code

Transports

Protocols

Servers

Implementing and running the service

Implementing and running the client

C++

Generating the code

Examining the code

Transports

Protocols

Servers

Implementing and running the service

Implementing and running the client

Summary

6. Handling Errors in Apache Thrift

What are the type of errors that can occur?

Syntax errors

Runtime errors

Logic errors

What are exceptions and how to handle them?

Handling exceptions in Apache Thrift

An example code

Implementing the divide method

Running the application without error handling

Adding error handling to the server

Adding error handling to the client

Advanced error handling

Summary

7. An Example Client-Server Application

Our example application

Planning out your work

Getting a general idea of the example application

A technical overview of the application

get_distance

find_occurences

save_to_log

The server

Clients

Preparing the Apache Thrift document

The basic toolbox – base.thrift

The MyToolbox service – mytoolbox.thrift

Compiling the IDL files

Implementing the server

Imports

Displaying errors on the console (logger)

Implementing service methods

Creating the server

Running the server

Implementing and running clients

Creating a client in PHP

Creating a client in Ruby

Further testing and other exercises

Summary

8. Advanced Usage of Apache Thrift

Apache Thrift in production

Code version control systems

Code deployment

Apache Thrift versioning

Apache Thrift performance

Comparing Java servers

Comparing C++ servers

Service multiplexing

Security issues

General security tips

Transport Layer Security/Secure Sockets Layer

Generating keystores

Using keystores in the Java code

Real-world examples of the usage of Apache Thrift

FBThrift in Facebook

Apache Thrift in Evernote

Apache Thrift in Twitter

Apache Thrift in other companies

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部