Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Database - Client/Server

  Asked By: Jimmy    Date: Jun 13    Category: Java    Views: 720
  

I need to avoid going to the server database each time from the client.

I need to put the database values on the client in XML or text.But the
values are changing dynamically.

How do i achive sync between client / server data.

OR any other way i can achive this .

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Devrim Yilmaz     Answered On: Jun 13

instead of xml  or text  in client  side u may use small databases such as hypersonic or derby.
then u should make ur own sync mechanism. the sync mechanism can be anything u like.
if u did not manage to make it then let me know.

 
Answer #2    Answered By: Ella Brown     Answered On: Jun 13

you need XML or other means of data  definitions as metadata. to represent the object model.

let me propose an architecture here:

you can use the XML metadata to provide a view of the object model to the client, so your client  will always know about the abstract structure of the data stored within the data source.

now to resolve the issue with synchronization, there are two possible ways to synch client with actual data

1. manual synch, which is the ondemand initiation of synch request by the client and the latest data will be then retreived from the data store and client will be populated. this is simply the method invocation by the client to perform a manual synch

2. event driven, which every time  the data is modified, an event will be triggered by either business tier or integration tier components to the client. This event will include the new values  for the modified data (the discussion as the trigger should be initiated by which tier is not in the scope of this email, but the component that updating the datastore will be triggered the event, you need an entry point on top of your DB. do not let direct access to DB)

note: while your data are changing  dynamically, event driven approach is what you need, in fact is the most common solution.
the event can be in the shape of XML messages and the new value in the context of XML formatted message, or alternatively it can be a java value objects passed to the client. one way or another, the client will receive the event and update its view based on the new value received as the modification happens. this will perform the automatic synch.

we are not discussing any strategy as how you design this here, it could be MVC, event drivern architecture or other possible strategies, and it is open for discussion.

--- But the important fact is that you need an event handling system here. ----

above are the common abstract solutions to synchronization of client and data sources, how you implement it, is up to you,

 
Didn't find what you were looking for? Find more on Database - Client/Server Or get search suggestion and latest updates.




Tagged: