• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database location (a different approach?)

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,

I've just started my URLyBird project. I have read the posts on here about database location and these seem to suggest there are 3 modes of operating and needing the database location

1) Standalond
2) Client
3) Server

Now my thought are this...the server doesn't need to know where the database is until a client connects to it. Therefore when the server is started for the first ever time (before it has been able to put an entry in the properties file) it just sits there without a database. Then when the first client comes along you tell it the server IP and it connects and the server sends a message back saying "I don't have a database could you please set one" at which point the client pops up a gui gets a location and then tells the server that writes this into its property file. This then avoids the server having to have a gui/command line option/user typing in the location of the database/etc.

Comments?
 
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Innovative, but I am not sure if I like this approach. I have two issues:

1) What if two clients try to connect at the same time before the server knows the data file location? I.e. Client A tries to connect, gets the "I can't find data file" response, then while he/she is typing in the location, Client B tries to connect and gets the same message. Client A sends back a valid file and connects. Client B sends an invalid file and does not connect... Or, Client B sends a different but still valid file and also connects... Do you see where I am going with this?

2) This would also make for a maintenance/upgrade nightmare. In a real world application, I would be pushing hard for the customer to upgrade to a true database system. If and when that time comes, I should be able to switch out data systems without the client ever noticing. Basically, the data layer should be transparent to the presentation layer!
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neil Renaud:
Hey all,

I've just started my URLyBird project. I have read the posts on here about database location and these seem to suggest there are 3 modes of operating and needing the database location

1) Standalond
2) Client
3) Server

Now my thought are this...the server doesn't need to know where the database is until a client connects to it. Therefore when the server is started for the first ever time (before it has been able to put an entry in the properties file) it just sits there without a database. Then when the first client comes along you tell it the server IP and it connects and the server sends a message back saying "I don't have a database could you please set one" at which point the client pops up a gui gets a location and then tells the server that writes this into its property file. This then avoids the server having to have a gui/command line option/user typing in the location of the database/etc.

Comments?


I am going to have to disagree with your approach. The client should have absolutely no knowledge of where the database file exists on the server side. The server should decide this, not the client. What if the server is on one computer and the client on another (we can't just assume it'll always be localhost), how will the client know where the database file is? For local mode, the client will select the database, but in network, the client should have no knowledge of its whereabouts, only the server. What if in real life, Sun allowed the users to "roam" around on their server trying to find the database. Considering some of the security measures they take to even take this exam, I can't see them too gun-ho on this one either.
[ January 19, 2005: Message edited by: Daniel Simpson ]
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The networked clients should probably no very little about the server file location. If you don't want to provide a server GUI, you could allow your standalone client to do the data file and port selection. The server can then start up headless. I provide a simple GUI for the server that allows the sysadmin to set these. Its not difficult and its actually easier to describe.
 
Neil Renaud
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All valid points.

I guess it is just the enviroment I work in but I always see servers as command line only applications e.g. no GUI as such to enter a database location it would have to be typed at a command prompt but I really dislike that idea.

I'm guessing people have done a server GUI and passed then. In which case I'll do that.

Neil
 
Daniel Simpson
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neil Renaud:
All valid points.

I guess it is just the enviroment I work in but I always see servers as command line only applications e.g. no GUI as such to enter a database location it would have to be typed at a command prompt but I really dislike that idea.

I'm guessing people have done a server GUI and passed then. In which case I'll do that.

Neil



Quick note, Neil. My specs did not allow me to do any configuration whatsoever through the command line besides supply the flags "server" or "alone." I would read over your specs carefully with that, because to configure through the command prompt would be violating a must in my case. Also, it says another must is to configure settings through a GUI. That's the choice I did, and it's pretty quick and easy to do.
 
Neil Renaud
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do have a must not have command parameters.

I do have a "all configuration must be done via a GUI" but as the only GUI ever mentioned is the client GUI I assumed it would have to be done via that. I guess as they haven't mentioned it I assumed I shouldn't make a server GUI i'm new to reading these specs as you can tell
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic