4

I am evaluating various Java object distribution libraries (Terracotta, JCS, JBoss, Hazelcast ...) for an application server and I'm having trouble understanding their behavior on various axes.

My requirements for distributed objects are not many -- they boil down to one-to-one and one-to-many messaging. There's more, but for the rest we just use JDBC and I assume I can plop a cache in front of this using any of the available libraries.

I would like a system that distributes objects and exhibits locality properties -- in other words, a server that grabs an object tends to hold onto it without excess communication to other nodes. Hazelcast looks simple (and peer-to-peer is nice) but seems to require objects are distributed evenly across all nodes.

I'd like a way to persist objects, preferably transparently. I plan on using EC2, so I have the option of temporary, free, limited local storage (the disk) and permanent, non-free, unlimited storage (S3). It'd be great not to worry about OutOfMemoryErrors.

I like the simplicity and "magic" of Terracotta but it scares the beejeezus out of me. Also in order to truly scale you have to spend $$$$, otherwise you're communicating with a single hub.

I'm cheap and I want something not only free but mature and with a large userbase.

Thanks for any input.

4

4 回答 4

2

Terracotta seems like a perfect fit for your situation.

  • It's simple to setup
  • it can be configured to be persistent (use an EBS volume for EC2)
  • it's closely integrated with Ehcache (actually Terracotta bought Ehcache) for great distributed caching performance
  • the free offering scales pretty well with several clients.

Just start playing around with it. I bet you'll love it. To ease your performance fears, simply run a through put test for message passing. This shouldn't take much more than an afternoon of your time.

I have to admit that I haven't used Terracotta for a year and that I don't know the others you suggested.

于 2010-02-19T17:53:35.350 回答
1

是的,Hazelcast 会将您的对象分布在整个集群中。但是,如果您想降低通信成本,您可以启用近缓存。 http://www.hazelcast.com/documentation.jsp#MapNearCache

于 2010-04-19T14:15:55.417 回答
1

兵马俑确实符合要求。我理解你的反对意见,但这是我的评论:

1)兵马俑确实表现出局部性-与您提到的那些相比,它可能是最好的系统。对象仅在请求时被引入本地 JVM。使用租赁机制执行读取或写入锁定。这意味着如果您在系统中表现出完美的局部性,那么您将产生非常少的网络开销。

2) Terracotta 提供开箱即用的磁盘持久性 - 在 OSS 版本中(您不必支付 $$$$)

3)为什么它让你这么害怕?只需使用 EHCache 作为缓存,或 Hibernate 2nd Level Plugin。它非常容易设置和使用。

4) 是的,Terracotta FX 需要您付费(用于横向扩展服务器)。但是,我建议,如果您的系统主要被读取并显示出真实的局部性,那么我认为您在获得所需的规模时不会遇到问题。使用 Terracotta 3.2,Hibernate 2nd Level Cache 的性能是 100,000 ops/s,使用 8 个应用程序服务器和一个 Terracotta 服务器,读/写比率为 100/0,使用相同配置,读/写比率为 12,000 ops/s,读/写比率为 95/5。

(我刚刚为湾区 SDForum 就这些数字做了一次演讲,所以我碰巧把它们放在手边)

于 2010-02-23T08:56:13.663 回答
0

顺便说一句,目前尚不清楚您在寻找什么(消息与集群/分布式对象不同)。

如果您正在寻找 Java 中的消息传递,我建议您查看 RabbitMQ(它基于 Erlang,但没关系)。

于 2010-02-23T08:59:00.850 回答