tag:blogger.com,1999:blog-13838184.post6207823573686083532..comments2023-09-18T16:21:55.012+02:00Comments on Luca Garulli - The Zion City (OrientDB): Terracotta as distributed DBMS? Bad idea!Luca Garullihttp://www.blogger.com/profile/04523569178463279505noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-13838184.post-86944104205178441582009-11-19T09:32:43.581+01:002009-11-19T09:32:43.581+01:00Mickey,
Pretty much everything you claim about ou...Mickey,<br /><br />Pretty much everything you claim about our product in your follow up post is wrong. BTW, please please please keep telling your prospects during sales meetings that we require shared storage. Great tactic to lie to people there ;)<br /><br />BTW, I wonder what all these misleading statements suggest about your claims for your own product ?!?Unknownhttps://www.blogger.com/profile/08864794870737829029noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-41502184088133979412009-11-16T16:19:20.446+01:002009-11-16T16:19:20.446+01:00It was extremely interesting for me to read the po...It was extremely interesting for me to read the post. Thanks for it. I like such topics and anything that is connected to them. I would like to read more soon.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-13838184.post-10567219779729187342009-11-10T18:41:16.165+01:002009-11-10T18:41:16.165+01:00Ari,
thank you for changing the "shut-up"...Ari,<br />thank you for changing the "shut-up" to "Please be quiet", let's try to keep the discussion on a professional level.<br />Now to your point (@see WHAT!?!?!?!)<br />Yes we don't block the user when a back-node fails instead we start a new one immediately. You can have more then one backup to reduce the chances for failure in that case as well.<br /><br />With in-memory technology using any synchronous calls to disk is a bad idea. Relying on disk for high availability makes things even worse. We assume that machines and disks! can crash completely, we rely on pure commodity hardware setup and we don't rely on third party database (+the extra cost associated with its support) to maintain our in-memory reliability. This enables us to be elastic. In our case a backup can start on completely new machines without relying on any shared disk storage. <br /><br />As a side note in earlier versions we used to throw an exception in such an event but through the experience with our users we learned that non of them turned this feature on from the reason I mentioned earlier and decided to drop it entirely. If you would look at all other in-memory data-grid solution you'll find that they do pretty much the same thing.<br /><br />I would doubt that Any of your users choose to turn synchronous write to disk on as the performance penalty diminish the value of having solution like Terracotta in the first place. <br /><br />In other words I would argue that having more options to deal with pure memory based reliability fits better in the realm of large scale deployment then relying completely on synchronous filesystem.<br /><br />and lastly, with GigaSpaces you can register to cluster state change notification + you have the "admin API" that gives you the power to completely handle the cluster in 2 lines of code...Mickey Alonhttps://www.blogger.com/profile/15186249863076641399noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-14509599525219276662009-10-09T16:43:18.342+02:002009-10-09T16:43:18.342+02:00Jerry: We provide CA - Consistency and availabilit...Jerry: We provide CA - Consistency and availability. Partition-tolerance means that you can survive when the network is down and run autonomously, resolving conflicts later. We cannot.<br /><br />--AriUnknownhttps://www.blogger.com/profile/08864794870737829029noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-33879380252965365722009-10-08T07:51:57.463+02:002009-10-08T07:51:57.463+02:00Hi Ari,
Thanks for your sharing.Based on what you...Hi Ari,<br /><br />Thanks for your sharing.Based on what you said and if I understand correctly, Terracotta provides the scalability, the performance and ACID without compromising availability.<br /><br />One question remained is that how can Terracotta provides all these nice properties at the same time? I mean the CAP theorem states that you can only have 2 of them (CAP: consistency, availability and partition tolerant) for a reliable distributed system. How can Terracotta provides all three properties at no cost (if there are some hidden costs)?<br /><br />Cheers~<br /><br />JerryJerry Lamhttps://www.blogger.com/profile/10293023369883108062noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-72212525294903696752009-10-07T16:32:48.043+02:002009-10-07T16:32:48.043+02:00Hi Jerry,
theorically you don't need to write ...Hi Jerry,<br />theorically you don't need to write data to disk. If you have a cluster with 10 nodes distributed around the world the probabilities that all 10 nodes crash at the same time is really remote.<br /><br />This is the theory. In the practice you need to write data in a persistent way for many other reasons:<br />- mantainance: sometime your objects/data changes and migrate them while the servers are running could be hard (or impossible)<br />- reporting: if you store data in a common RDBMS you can use the most famous reporting tool that work on top of a ODBC/JDBC driver<br />- psycologic? :-)<br /><br />bye,<br />Luca GarulliLuca Garullihttps://www.blogger.com/profile/04523569178463279505noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-64803586281564874622009-10-07T16:32:36.937+02:002009-10-07T16:32:36.937+02:00Jerry,
Terracotta (TC for short) is ACID and it p...Jerry,<br /><br />Terracotta (TC for short) is ACID and it puts its data on disk and it does so at 10X the throughtput and an order of magnitude lower latency than that of the other IMDGs. In fact, extensive testing we have completed shows the IMDGs are same performance as MySQL! They are just more scalable. Terracotta is both faster _and_ more scalable at the same time. I am sure this sounds like hype so let's break it down here:<br /><br />1. Terracotta offers causal or strict ordering. No one else does. Causal == you are always guaranteed to see everything that happened before you in other JVMs while still running asynchronously with those JVMs. This is _hard_ to figure out but we have done it. Know who else does this? The JVM itself! Threads are guaranteed to see what happened to main memory before they got to that page to read it. We do the same--this is causal ordering (whatever causes the memory I care about to be in the state it is when I get there is guaranteed to execute before I can see it). Strict ordering means that everything happens in the time-ordered sequence it occurs in reality. If JVM1 changes something before JVM2, even if JVM2 doesn't care, the 2 will guaranteed fly in that order to the cluster. (BTW, this is what Mickey is upset about with Terracotta. He doesn't understand causal ordering and thinks it is async and wants to say this is how TC can go so fast. It is not cheating. It is just not strict ordering--just like the JVM--and thus WAY faster and lower contention than his product).<br /><br />2. We leverage causal ordering technology plus asynchronous programming plus our networked high availability to give you ACID to disk at in-memory speeds. Can the disk bottleneck Terracotta, yes? Have we cheated the laws of physics? No. But we decoupled having the disk write as part of the transaction. Everything your JVM does gets written to our server and its partner. The 2 servers have your data in memory and if one dies, the other will return the data. If your JVM doesn't hear from both our servers that your data is in memory, it will keep resending the data till we have it safe on our side. Next step, we look at all the data changing per unit time, organize it and write it to disk in an efficient way. So envision our server has having 4 copies of your data. One in one TC instance, the other in the other TC instance, both in memory at in-memory speed PLUS both servers write the data to disk as fast as possible. If they can't keep up with the rate of write in the app (which has to be very high) then you can start 3, 4, 5 or n copies of TC each writing 1/nth of the data to their disks (partitioning in the caching layer, well above the disks, just like Memcache, but with disk durability built in).<br /><br />Now, it is worth noting that Terracotta is taking the time in memory to pack and organize what it writes to disk so we get full streaming throughput of the disks at our disposal--just like a good DB. We can write 80MB/sec to disk. And if you stripe that data across 2 or 4 disks, we can get 300+MB/sec to disk. Per Terracotta Server. Or, you can just run 1 disk per Terracotta server and run 4 Terracotta servers each on its own box and they can get the same 300+MB/sec to disk with zero bottlenecks.<br /><br />There you have it--a recipe to piss off the competition and provide ACID to disk at in-memory speed all in one box.<br />a) they are pissed because they do everything with strict synchronous ordering and we don't so they are going very slow<br />b) we are writing everything to disk on 2 boxes simultaneously and we write things that logically must happen before others in the correct order and we guarantee no one misses changes he needs so we are ACID (atomic, consistent, durable are most of what I explained here)<br />c) We are fast because we detect causality (not making one thread wait for any others if he doesn't have to) and we then go asynchronous allowing threads unrelated to each other to not block in any way shape or form.<br /><br />Cheers,<br /><br />--AriUnknownhttps://www.blogger.com/profile/08864794870737829029noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-31145774075147394932009-10-07T15:50:15.366+02:002009-10-07T15:50:15.366+02:00I came across this blog and I would like to ask th...I came across this blog and I would like to ask the following: <br />- How does Terracotta handle ACID if it is possible at all? <br />- What is the scalability of Terracotta when ACID is required? <br />- If Terracotta uses disk to maintain ACIDity, what is the difference between Terracotta and a DB? Will I/O becomes Terracotta bottleneck at the end?<br /><br />The reason I ask these questions is because ACID is a must property for DBMS. <br /><br />What I understand so far is that if you need 100% durability, disk will provide the highest guarantee. If performance is the key metric then you might go for in-memory solutions which trade performance with A.C.I.D.. A good in-memory solution should give you many gray levels of optimization which balances well with your complex requirements.Jerry Lamhttps://www.blogger.com/profile/10293023369883108062noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-29671019009645537782009-10-06T16:38:05.804+02:002009-10-06T16:38:05.804+02:00Mickey,
Please be quiet. Your product is the mos...Mickey,<br /><br />Please be quiet. Your product is the most dangerous on the market. It has no true synchronous replication. From your docs:<br /><br />--------- <br />In a synchronous replication scheme, the client receives acknowledgement for destructive operations only after both sets of the spaces (source and target - that is, master and backup spaces) have performed the operation.<br />When the master is active and the backup is not active, the client receives acknowledgement from the master space; the operation on the backup space is performed only when the backup space is restarted. The master logs all operations until the backup is started, the same as when working in asynchronous mode.<br />------------ <br /><br />Are you serious: the master ACKS a transaition when the slave is gone and queues it till later? IN SYNCHRONOUS REPLICATION MODE? WHAT?!?!?!?!<br /><br />--AriUnknownhttps://www.blogger.com/profile/08864794870737829029noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-80035294656023820882009-10-06T12:12:19.603+02:002009-10-06T12:12:19.603+02:00A simple fact is memory to memory is by far faster...A simple fact is memory to memory is by far faster than memory to disk, if you are getting extreme TPS and using a disk for durability look for the holes as Luca did...<br /><br />peace,<br />MickeyMickey Alonhttps://www.blogger.com/profile/15186249863076641399noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-26289427927772941532009-10-04T12:28:23.188+02:002009-10-04T12:28:23.188+02:00Hi Luca,
I'm currently working at a Terracott...Hi Luca,<br /><br />I'm currently working at a Terracotta-based key/value store, and I'm experiencing far better performance results than yours: so feel free to contact me for any question, you already have my contact details ;)<br /><br />Cheers,<br /><br />Sergio B.Sergio Bossahttps://www.blogger.com/profile/09315991044338298083noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-47253096895511749782009-10-04T09:57:46.450+02:002009-10-04T09:57:46.450+02:00Hey Luca,
2 things I wanted to comments
1. reliabi...Hey Luca,<br />2 things I wanted to comments<br />1. reliability<br />2. durability & performance<br /><br />first, the default with Terracotta seems to give you fare performance numbers, BUT you didn't know (as it is not clear to many) you are running in un-reliable mode, which I find VERY disturbing.<br /><br />second, it is not true you need to scarify durability in order to have better performance if you use clustered memory solution, the backup is expected to be in memory and failover should take place in your scenario<br /><br />you can check-out GigaSpaces: www.gigaspaces.com<br />We have a community edition that might fit your needs.<br /><br />Good post<br />MickeyMickey Alonhttps://www.blogger.com/profile/15186249863076641399noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-15777218202974624022009-10-02T12:52:50.457+02:002009-10-02T12:52:50.457+02:00jee, I hope this isn't the only bit of code yo...jee, I hope this isn't the only bit of code you've used for the benchmark because it is very very deficient in any aspect of benchmarking that would lead me to believe that these numbers have any meaning at all.<br /><br />Have you validated that any or all of the machinery is working as you believe it to be working? Can you account for the time?<br /><br />I really believe Ari was being polite when he asked for your harness. You've slammed his product without any evidence. Very unprofessional and almost slanderous. Microbenchmarking can be achieved and useful but not if you're not willing to invest the time into creating a good benchmark.<br /><br />Regards,<br />KirkUnknownhttps://www.blogger.com/profile/18065517527062806710noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-11096666856465369532009-10-02T06:37:38.980+02:002009-10-02T06:37:38.980+02:00The second test is not a good simulation at all of...The second test is not a good simulation at all of a read/update scenario, but I don't want to get into that discussion on the comments.<br /><br />Regarding sync vs. async, every modern DB has the ability to be ACID or not ACID. The reason for this is the same reason Terracotta also gives you that option - trade durability for performance. <br /><br />As I said, you can design your object model to have sync and async operations, and limit the amount of sync operations that need to be performed by intelligently combining the two.Taylorhttps://www.blogger.com/profile/07193759050963768511noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-78919416875196405772009-10-01T20:07:49.624+02:002009-10-01T20:07:49.624+02:00Hi Taylor,
the 2nd time the test was executed it c...Hi Taylor,<br />the 2nd time the test was executed it could be a sort of simulation of what happen in read/update transactions as comparison of a DBMS.<br /><br />About the asynchronous issue it's not just a matter of Isolation but of consistency. If I tell to the user "Ok, your data was saved", I can't risk to loose the user's data if something goes wrong in the network or the process dump.<br /><br />This is the reason why using Terracotta as distributed DBMS can't be a real solution. Maybe setting the synchronus mode it works but it's unacceptable as throughtput IMHO.<br /><br />Terracotta remains a good product, but for what it has been designed ;-)<br /><br />Bye,<br />Lvc@Luca Garullihttps://www.blogger.com/profile/04523569178463279505noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-13404271442789402312009-10-01T19:55:02.080+02:002009-10-01T19:55:02.080+02:00I should add that the death of any distributed sys...I should add that the death of any distributed system is to operate synchronously. If you start moving in that direction, and do it without careful design, you're going to end up with a very slow system. If you've ever benchmarked 2PC (XA) systems, you'll know what I mean.<br /><br />What you want to do is examine your problem domain very carefully and understand exactly where things must be synchronous, and where they can be asynchronous. Then do everything you can async, and do as little as absolutely possible sync. <br /><br />In other words, a blanket approach switching everything sync is going to be slow, and a microbenchmark will probably show that.<br /><br />Furthermore, one thing you need to be very careful of here is understanding that Terracotta can go several times as fast as you (and I) are "benchmarking" because these tests are single-threaded. Terracotta is designed to be very concurrent (distributed systems are very concurrent) and as such it's impossible to gauge the full throughput using only a single thread of execution.Taylorhttps://www.blogger.com/profile/07193759050963768511noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-44898693653356946132009-10-01T19:47:15.132+02:002009-10-01T19:47:15.132+02:00Luca,
1) Something like that, yes. I use Yahoo! ...Luca,<br /><br />1) Something like that, yes. I use Yahoo! Pipes. Here's something similar I blogged about: <a href="http://javathink.blogspot.com/2007/06/so-you-want-buzz-eh-do-it-in-style-with.html" rel="nofollow">Terracotta Buzz</a><br /><br />2) Running the test twice doesn't make sense. You're overwriting the keys, so the second run is a load and overwrite, where the first test is just a load. A real-world app wouldn't be starting cold like that, so it would be better to run the load test twice inside the same client overwriting keys on the second run to test overwrite performance. That said, if startup and load times from cold are an issue for you (and for some people it is depending on data-set size and SLAs) then there are many many approaches to take. The easiest of which is to set the fault-count parameter in the tc-config.xml which increases the batch size of objects loaded.<br /><br />3) The reality is a bit more complex than that. Yes, the changes are being written asynchronously, but they can never be seen by any other client in an out of sync state, so for all intents and purposes in a healthy running system the system never exposes out of sync data. However you must understand this is the DEFAULT mode, and you can change that to get more or less strict semantics. If you really care about changes being written synchronously you can change the lock setting to be synchronous, instead of asyncronous. This is controlled in the tc-config.xml file. Actually, the algorithm used is precisely the same used modern JVMs to synchronize memory between threads on multi-core processors, if you just replace "processor" with "TC client" and "system memory" with "TC Server" and "system bus" with network. Of course in the case of TC the latencies are speeds are all orders of magnitude (several) slower since processors and the system bus operate on nanosecond and microsecond scales where network operates at millisecond scale.<br /><br />Does that help? I'll have to go with Ari on this one, I don't think you're actually observing what you think you are observing. The reality is a bit more involved. As you state yourself, micro-benchmarks are never a good idea :) But if I had been in your shoes I certainly would have been surprised by such poor numbers. Glad you posted about it anyway instead of just jumping ship alltogether.Taylorhttps://www.blogger.com/profile/07193759050963768511noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-3272707764528838042009-10-01T19:25:12.028+02:002009-10-01T19:25:12.028+02:00Hi Taylor,
thank you for your prompt response (Goo...Hi Taylor,<br />thank you for your prompt response (Google Alerts? :-))<br /><br />I tried the exactly the example of your blog with the only difference in setting the server persistence mode as "permanent-store" (but probably is by default).<br /><br />You're right. The first 100.000 objects took only 23 seconds: 4.300 objects/sec. But repeating the same test once again (so starting with 100.000 objects in terracotta) tooks 158 seconds! Now we are at 644 objects/sec. 7 times bad. Summary:<br />- 1: 4.300 obj/sec<br />- 2: 644 obj/sec<br /><br />And please consider that this test runs in local. The same test against a remote server (cleaning all previous objects) is much slower:<br />- 1: 1.960 obj/sec<br />- 2: 25 obj/sec<br /><br />So try to execute your microbenchmark at least 2 or 3 times and collect the result.<br /><br />Furthermore this results are not valid since the objects are not REALLY written when the "elapsed" is print. <br /><br />What about this asynchronous problem? Running in localhost the time between the application prompts the result and the end of the same app is less then 1 second, but in the remote test this time is (obviously) larger. What happen if I kill the client just when it gives me the "elapsed"? All my objects are definitely lost...<br /><br />bye,<br />LucaLuca Garullihttps://www.blogger.com/profile/04523569178463279505noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-31953705563279152502009-10-01T17:59:53.870+02:002009-10-01T17:59:53.870+02:00Luca,
You're right, micro-benchmarks are a b...Luca, <br /><br />You're right, micro-benchmarks are a bad idea, but your performance test seems off by at least an order of magnitude. <br /><br />I just wrote a simple test to load 100,000 objects into a Map. On my recent model MacBook Pro (2.2 GHZ) I see ~3,000 objects created / sec.<br /><br />It seems to me there must be something simple that you've overlooked, not sure what it could be though.<br /><br />I wrote a response on my blog to show you the code I used - maybe we can figure out together what is going wrong in your test?<br /><br /><a href="http://javathink.blogspot.com/2009/10/simple-load-test-in-terracotta.html" rel="nofollow">http://javathink.blogspot.com/2009/10/simple-load-test-in-terracotta.html</a>Taylorhttps://www.blogger.com/profile/07193759050963768511noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-35064288567364871802009-10-01T17:58:17.856+02:002009-10-01T17:58:17.856+02:00Interesting. You _might_ consider asking for a bi...Interesting. You _might_ consider asking for a bit of help because you are getting results about 100X below what Terracotta can do. Perhaps you are not doing what it is you think you are doing.<br /><br />Its hard to tell w/o your code or harness or anything. What confuses me is, of the 3 or 4 people who I have seen get this poor a result, they all seemed to post on our forums and assume they were doing something wrong. In fact, we were able to tune up their app or show them a small change that sped things up right away. Why not take the approach of assuming something is wrong in this case as well?<br /><br />BTW, When using Terracotta's new Ehcache product we are reliably getting 150K transactions per second where MySQL is getting 1900. Please feel free to post your use case to our forums and we'll see what we can do.<br /><br />Cheers,<br /><br />--Ari<br />CTO, Terracotta, Inc.Unknownhttps://www.blogger.com/profile/08864794870737829029noreply@blogger.comtag:blogger.com,1999:blog-13838184.post-67936596091751671792009-10-01T17:57:18.665+02:002009-10-01T17:57:18.665+02:00This comment has been removed by the author.Taylorhttps://www.blogger.com/profile/07193759050963768511noreply@blogger.com