@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3



Comments:

<0> hello, i was wondering if i could ask some architectural questions about using java?
<1> What sort of questions? it smells like stuff that is explained in the first two chapters of your coursebook
<0> heh
<0> this isn't a coursework question
<0> im writing a "game" of sorts
<1> Well, in any case. You can always ask. At worst you don't get an answer.
<0> basically a web game with lots of traffic
<0> ok
<0> my question is really a blueprints question - right now my game's clients send results to a web service
<0> that web service then handles sending the results to the persistance mechanism, whatever that may be
<0> i guess the best way to sum up my problem is, whats the best way of handling asynchronous events that have priority?
<0> aka, if game1 sends a message to the web service
<0> and game2 does too,
<0> how do i handle synchronization issues?
<0> maybe a better example
<2> the persistance mechanism (usually a database system) handles that for you



<0> ok but lets step back one
<0> here's my architecture: game ----- web service ---- messaging layer --- persistance
<2> okay
<2> does game1 have to be processed before game2 is dealt with?
<2> if so, then you need to deal with the concurrency in the web-service...or timestamp the requests in some manner
<0> hm
<0> timestamp seems like an idea
<2> ideally, you try to design it so you need to do as little like that as possible
<0> ya
<0> well "writing" isn't hard - i just write updates to my message topic
<0> but reading is a problem, because if persistance object 1 is out of sync with object 2
<0> then they'll return different results, which is where im at now
<2> how can they get out of sync?
<0> well
<0> lets say some network traffic happened, something that caused an update message not to be received
<0> i dunno, im just trying to plan for everything
<0> or maybe one database server went down
<0> so it missed a bunch of update messages
<0> im trying to get around this by reading up on transactions on jms
<0> i just switched to spring 2.0 from 1.2, and since it does asynchronous messaging i think i can add transactions to my messages
<2> jms is nice, yes
<0> which SHOULD prevent this
<0> because if a db server goes down, then it should have to do all the messages it missed FIRST, before any requests for data
<2> yes
<0> but i just wanted to see what someone else though about all this :)
<0> i've learned everything myself so i don't have the benefits of others' experience
<2> it's queue. First on, First off
<0> ya, although in this case its topic
<0> because all subscribers need all the data
<2> okay
<0> does that sound right?
<2> only thing to be careful of with topics is making sure that if a subscriber dies for whatever reason, that the topic doesn;t grow beyond all reason
<2> I've had that happen
<0> ah
<0> well thats something i'll need to take into account then
<0> because the whole point of this architecture is to be as fail-safe as possible
<2> one of the subscribers dies, next thing you know there's a million messages on the topic and I'm out of diskspace
<0> if subscribers die it should not affect the system
<0> lol
<0> hmm
<0> so how do i get around that?
<0> that makes it sound like the topic model has an upper limit, something i dont want
<2> of course it has an uppre limit
<2> diskspace isn't infinite
<0> well
<0> besides that sorta thing
<2> it's configurable
<0> but does that mean the model isn't suited for what im trying to do?
<2> my topics are configured to have a limit of a million messages.
<2> no, it is
<0> ok
<2> a million messages for my application is about 3 days worth of work. I *should* notice by then that something is wrong :)
<0> heh
<0> well here's my next question then - how do i go in reverse? aka
<2> if I don't limit it somehow then I can run out of diskspace...that would be BAD
<0> game 1 sends a request to the web service asking for some data, which then forwards it to the messaging layer
<2> and cause me to lose data
<0> how does the messaging layer ask for data from persistance? i can't imagine topic woudl work here
<0> because you'd get X replies to a "give me data X" topic
<0> X being the number of persistance servers
<2> depends. What's the persistence layer?



<0> databases
<2> jdbc then
<0> well i know that
<0> but conceptually
<0> how does the messaging layer know who to ask?
<2> it asks the database. Who else would it ask?
<0> yes, but ***ume there are 100 databases
<0> which one does it ask?
<2> well, conceptually, there should be only one database. It might live on 100 servers, but it's only one database
<2> that's a design issue
<0> ya, sorry
<0> conceptually there is one database
<0> i guess thats what my question is - what does that "conceptually" mean
<2> so what does it matter what instance of the database you ask?
<0> well not really
<0> as long as the data is up to date
<2> they're all the same
<0> we hope
<2> it is
<2> that's the responsibility of the RDBMS
<0> well, i was kind of using jms as my replication scheme
<2> yuck
<2> don't do that
<0> hm
<0> how come?
<2> that's BOUND to fail
<0> ah
<0> hmm
<2> JMS makes no promises *when* messages will be dealt with. Only that they will be dealt with in the order they arrive
<0> i was really trying to avoid using rdbms-specific replication stuff
<0> well thats fine
<0> as long as the messages are delivered in order, then i dont have syncing problems
<0> if i have two writes and a read
<0> as long as it delivers the read after the two rights and not some other time
<0> i'm fine right?
<2> so if you put the same 10 messages on 5 different queues, that's 5 *different8 queues. They might all process them at the same time. One might process it 10 seconds after everything else does
<2> no
<0> hmm
<2> each read/write is a single transaction
<0> ah i see
<2> you deliver two writes and a read, it might happen write-read-write or write-write-read
<0> hmm cra[
<0> well thats definitely bad
<2> all that is promised by JMS is that the first read will read the message sent in the first write
<0> hm
<2> don't use JMS to manage data replication, it WILL go bad
<0> ok
<2> use the RDBMS to do that
<2> that's whose job it is
<0> i guess i just didn't want to use software specific stuff, and have the architecture take care of it
<0> but your comments make a lot of sense :)
<0> so then i want to have jms talk to one persistance layer object
<0> maybe using something liek http://c-jdbc.objectweb.org/
<0> ever worked with anything like that? anything to recommend?
<2> I've never used that
<0> we're using mssql 2005, maybe i'll just have it take care of it
<2> does it manage the replication? Or just the load balancing?
<2> it's not clear to me from a quick glance
<2> mssql does clustering natively
<0> ya
<0> so i guess it might be easier to just let it do it
<2> not just easier...*safer*
<0> ok
<0> well i appreciate your talking with me :)
<0> this kind of discussion is invaluable since i dont get the hands on experience of others from reading the sun blueprints
<2> there's only one way to get experience...write code :)
<0> heh true
<0> well thanks again, back to coding i go! :)
<2> enjoy :)
<1> hmm. that is a depressing 12-hour list of nothing but quits and joins..
<3> heh
<4> Hello
<4> I'm working on a program runner that runs another java programs, but i'm in trouble because of bad programmed things the program cannot be run two times. I know it's because of static variables it uses. Is there any way to ensure that some cl***es and its static fields are unloaded so it could work on the second run without needing to restart java VM?
<5> how to just make a simple sleep(); in java?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #java
or
Go to some related logs:

#php
84.244.0.144:8080/listen.pls
long legged snooker rest called
#linux
progressbar javascript page load
Isshinryu kill
#AllNiteCafe
tarrast
#linuxhelp
#linux



Home  |  disclaimer  |  contact  |  submit quotes