Java 什么是兵马俑?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2761168/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is Terracotta?
提问by Derek Mahar
- What is Terracotta?
- What services does it offer?
- What problems does it solve?
- What other products solve problems similar to those that Terracotta solves?
- 什么是兵马俑?
- 它提供什么服务?
- 它解决了哪些问题?
- 还有哪些产品可以解决与 Terracotta 解决的问题类似的问题?
采纳答案by stefanglase
Find a great article about Terracotta and how it works at InfoQ written directly by Orion Letizi, co-founder and software engineer at Terracotta:
在 InfoQ 上找到一篇关于 Terracotta 及其工作原理的精彩文章,作者是 Terracotta 的联合创始人兼软件工程师 Orion Letizi:
http://www.infoq.com/articles/open-terracotta-intro
http://www.infoq.com/articles/open-terracotta-intro
It helped me to prepare for a webcast about terracotta and how it can be used for clustering and scaling grails applications and gave me a good overview about Terracotta.
它帮助我准备了有关 terracotta 以及如何将其用于集群和扩展 grails 应用程序的网络广播,并为我提供了有关 Terracotta 的良好概述。
回答by Derek Mahar
I found an article in JavaWorldabout Terracotta at http://www.javaworld.com/javaworld/jw-01-2009/jw-01-osjp-terracotta.html.
我在http://www.javaworld.com/javaworld/jw-01-2009/jw-01-osjp-terracotta.html在JavaWorld 中找到了一篇关于 Terracotta的文章。
回答by Fuad Malikov
What other products solve problems similar to those that Terracotta solves?
还有哪些产品可以解决与 Terracotta 解决的问题类似的问题?
Try Hazelcast, It is super simple to use. Peer to peer, highly scalable, fully open source clustering technology for Java. It is simply distributed Map, Queue, MultiMap, ExecutorService. You can use its Map as a distributed cache.
试试Hazelcast,使用起来超级简单。适用于 Java 的点对点、高度可扩展、完全开源的集群技术。简单来说就是分布式Map、Queue、MultiMap、ExecutorService。您可以将其 Map 用作分布式缓存。
回答by Val
I like to think about Terracottas DSO in terms of advanced parallel architectures: Terracotta turns your message-passing multicomputer into a usual unified memory multiprocessor. Multicomputers are different from multiprocessors in that processors share memory and, therefore, are easier to program because you just write into memory in usual multithreading way. Though, you it means that you need to explicitly synchronize access to the shared data using a lock, system saves you from the need to explicitly message-passing data marshaling and resolves the biggest parallel programming issue -- the cache coherence -- for you. Multiprocessor marshals the data for you when you take/release the lock. It is, therefore, desirable. But, initially you have a bunch of computers -- a multicomputer.
我喜欢从高级并行架构的角度考虑 Terracottas DSO:Terracotta 将您的消息传递多计算机变成通常的统一内存多处理器。多计算机与多处理器的不同之处在于处理器共享内存,因此更容易编程,因为您只需以通常的多线程方式写入内存。虽然,这意味着您需要使用锁显式同步对共享数据的访问,系统使您无需显式消息传递数据编组,并为您解决最大的并行编程问题 - 缓存一致性。当您获取/释放锁时,多处理器会为您编组数据。因此,这是可取的。但是,最初你有一堆计算机——一台多计算机。
The magic is achieved by injecting some code into your classes at object field/lock access points. To correspond DB world, Terracotta considers all updates done under a lock atomic (transaction). Likewise multiprocessors can have a global storage, Terracotta allows to back up the locally updated data to disk.
通过在对象字段/锁访问点处将一些代码注入到您的类中,可以实现魔术。为了对应数据库世界,Terracotta 考虑在锁原子(事务)下完成的所有更新。同样多处理器可以有一个全局存储,Terracotta 允许将本地更新的数据备份到磁盘。