Chapter 13. Communication between Erlang and Java via Jinterface

 

This chapter covers

  • Using Jinterface to communicate with Java programs
  • Building a bridge between Erlang and the HBase database
  • Integrating HBase with the Simple Cache application

In the previous chapter, we talked about interfacing between Erlang and foreign code via Erlang’s ports. That’s a useful and general approach, but it isn’t the most convenient route to take for every form of interaction. In this chapter, we talk about a different kind of interface, where the foreign code masquerades as an Erlang node and communicates over the Erlang distribution protocol (see chapter 8). Fortunately, the Erlang language implementers have already done a lot of the heavy lifting, providing solid libraries in C and Java to make this relatively easy.

After you rounded out your cache in part 2 of this book and made it suitable for use in enterprise environments, other people and organizations picked it up and started using it for their own projects. One of those groups needs to make the data persistent, rather than keep it in memory-resident Mnesia tables. Their requirement is to preserve all the data they insert into the cache more or less forever. You could switch the Mnesia tables to be disk resident, but it doesn’t feel like the right solution for a potentially huge data store. To help them out, you instead decide to add the ability to store the cached objects in an external HBase cluster.

13.1. Integrating Erlang with Java using Jinterface

13.2. Installing and configuring HBase

13.3. Building the bridge between Simple Cache and HBase

13.4. Integrating HBase with Simple Cache

13.5. Running the integrated system

13.6. Summary

sitemap