|
|
|
|||||
|
FreezeMap Use Clarification
In the Freeze documentation in Section 16.3.1 (page 371), one paragraph reads:
Quote:
Also, why must a Freeze map assume that it created all the entries in the database? Thanks, Ken Carpenter |
|
|||||
|
Perhaps I'm still thinking too data-centrically rather than middleware-centrically.
I plan to have a database that stores Commands. There will be many net-facing servers that need to write Commands to the database. Originally this would have been done by performing an INSERT SQL statement from each of the hosts. The database's concurrency mechanisms keep things straight. With Ice, I would instead define an insertCommand() interface in slice, implement the servant and run it on the database server. I would alsocreate a FreezeMap for the Commands that insertCommand() would use to insert into. The net-facing servers then simply call insertCommand(). From what you've described, I get the impression that as long as I only have one FreezeMap instantiated at any given time (i.e., no possibility of concurrent write access), then things will be fine, which is what I would expect. Just in case I need it (maybe I don't), if I create one FreezeMap within a read-only transaction and another within an update transaction, then there shouldn't be a problem, right? As long as I don't try to update the database. Thanks, Ken Carpenter |
|
||||||
|
Hi,
Quote:
Quote:
Quote:
Regards, Matthew |
|
|||||
|
Quote:
Will this not work? I believe I will need to do this or something that has a similar effect. I have a set of net-facing servers to answer queries, and a set of batch-oriented back-end servers doing wads of processing on the data that the net-facing servers answer queries on. This back-end processing is called a "turn" (the project is a massively multiplayer game). After each turn (10-30 seconds), I want the net-facing servers to "see" the results of the back-end processing. This must be transactional in nature. In other words, as far the net-facing servers are concerned all changes happened at the same time, so there is no inconsistency. When I was considering using a relational database, the net-facing servers would all begin read-only transactions on all the databases they might access. The back-end servers would then begin processing the next "turn". There would be many update transactions happening, however, the net-facing servers would not see any changes due to the multi-version concurrency control (MVCC) features of the database. Berekely DB claims to have the same feature. Once back-end processing has finished, the net-facing servers will then close their previous read transactions and begin new ones. The job of telling the machines to begin transactions, and begin processing is coordinated by a Turn Controller server. I think my net-facing servers might be good candidates for evictors, but my batch-oriented back-end servers don't seem to be. Thanks, Ken Carpenter |
|
||||||
|
Quote:
An important thing to note here is that Transactional systems are FAR FAR slower than non transactional systems. If you want entirely safe transactions (that is - no guarantee of loss) then you have to live with the fact that you can only get at best 70 transactions a second with standard hardware (due to the number of writes and syncs required). If you can stand to lose some amount of data then you can use other transactional models and get better throughput. Quote:
![]() Of course, you can use Ice as a simple RPC mechanism, ignoring the Ice object model completely, but then you lose a lot of functionality. Regards, Matthew |
|
|||||
|
Quote:
Code:
for (int i=0; i<NUM_ITEMS; i++)
{
Statement* stmt = conn->createStatement("UPDATE SHIPS SET NAME=:1 WHERE SHIPID=:2");
char name[100] = "updatetest";
stmt->setString(1, name);
stmt->setInt(2, i);
stmt->executeUpdate();
conn->commit();
delete stmt;
}
Quote:
![]() Thanks again Matthew, Ken Carpenter |
|
||||||
|
Quote:
However, consider that for a two phase commit transaction you need three atomic disk writes (txn_begin, txn_prepare, txn_commit) + the actual data write per transaction. For a disk with a 10ms seek time that equates best case to 30ms per transaction (if you have the data on a seperate disk) or ~33 transactions a second. If you start to relax the guarantees, or play other tricks (like not flushing the transactions or batching the transactions or a different less safe model) then you can get better rates. Anyway, don't take my word for it -- see the authorative guide on this subject (more than you'd EVER want to know) http://www.amazon.com/exec/obidos/tg...books&n=507846 The point is if you have a transactional system you have a slower, but potentially (not guaranteed) safer system. I assure you have you can get much better than 420 invocations per second with Ice ![]() Quote:
I don't have any good books to recommend to you. Michi, perhaps you have some good books? Regards, Matthew |
|
||||||
|
Quote:
Cheers, Michi. |
|
|||||
|
Quote:
There is nothing about "batching the transactions" that is "less safe" than commiting transactions serially. It is possible to deliver the full ACID transaction properties while performing group commits. The actual transaction throughput that a server achieves in practice will be affected by the level of contention of the active transactions. i.e. if they are all attempting to read/write the same data (high contention) then you won't get very good throughput, but if the transactions are not contending for the same data than the achievable transaction rates are much much higher. To give an example, at my previous employer (Bullant Technologies) we were building a transactional virtual machine. We managed to get around 50,000 transactions/second on an 8 processor PC for a benchmark that was specifically written to have no contention. cheers, mick |
|
|||||
|
Quote:
The code is basically the same as my previous post, but prior to the loop, you set a max interations value, and at the bottom of the loop, you call addIteration() instead of commit(). I'm at home right now, otherwise I'd just post the code. Even 25,00 object updates per second might be too slow for our application. We will probably have over 50 million objects to update every 10 seconds or so (5 million per second). Obviously this is spread over many servers, but still, it's a lot to ask! Ken Carpenter |
|
||||||
|
Hi Ken,
I agree that those are certainly high demands. In my opinion, having a cluster of distributed independent databases composed of cooperating objects is the best way of having scalability of this degree. Matthew |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bidirectional Socket Clarification | gsalazar | Help Center | 19 | 01-17-2008 06:24 AM |
| Documentation Clarification, Perhaps | acbell | Comments | 4 | 04-19-2007 11:37 AM |
| FreezeMap lazy initialize | xdm | Help Center | 3 | 03-01-2006 10:07 PM |
| .NET 2.0 support clarification | ttouris | Help Center | 4 | 02-10-2006 01:10 AM |
| FreezeMap Database Directory | Ken Carpenter | Comments | 1 | 02-28-2003 01:50 PM |