Chapter 10. Servers

 

This chapter covers

  • Building RPC servers
  • Understanding RPC server architecture
  • Learning about server concurrency models
  • Using factories to create per-connection handlers and custom I/O stacks
  • Processing server events
  • Using service multiplexing

This chapter is the culmination of part 2. At this point we’ve examined nearly all the moving parts within the Apache Thrift framework, from byte-level transport I/O all the way up to designing RPC Services. Our final framework topic is the Apache Thrift server (see figure 10.1).

Figure 10.1. The Apache Thrift framework server library

Servers are the conductors of the Apache Thrift RPC symphony. Apache Thrift servers provide prebuilt and tested hosting for user-implemented services. Each Apache Thrift language provides a different set of servers based on the needs and capabilities of the language.

Using a server from the Apache Thrift server library can greatly reduce the effort associated with deploying cross-language services. Servers handle almost all the difficult issues involved in programming high performance RPC services, such as concurrency management, scalability, and cross-thread communications.

10.1. Building a simple server from scratch

10.2. Using multithreaded servers

10.3. Server concurrency models

10.4. Using factories

10.5. Server interfaces and event processing

10.6. Servers and services

Summary