Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nvhoang115

macrumors newbie
Original poster
Mar 15, 2010
2
0
Hi guys,

I am currently implement a "alike" Client-Server application (no socket) as follow:

+ The Server: run an PostgreSQL database server for other clients to access, it also store some data files created by clients.

+ The Client: access database on server. It may create data files during execution; all these files are stored on Server.

The purpose is I want to store all data file created by clients on Server.

The current implementation is:
+ The Server creates a "full-sharing" folder.
+ The Clients mount (using MAC OS X utility) this folder and write data to it.

The question is:
Can I rely on this model (that the Server shall keep all clients' data)? or Can you give me better ideas?

Many thanks
 
There are some interesting implications about letting clients write data willy-nilly to a file share. It can be done if you handle the security implications correctly, and let the server have control to tell the clients where to write the files.

I think since it sounds like you are going the route of files needing to be pushed up to the server, and a SQL DB having links to it, something like an HTTP protocol for uploading/downloading the files will be a bit more portable... but there is no reason an SMB share can't do the same.

The key difference is that the server can open both the DB access and HTTP ports itself and control access in a centralized manner with a centralized set of credentials. If you go with a filesystem route, then the share's permissions have to be synced up with the server process, and the credentials would need to be synced between the two.

The HTTP route also has the bonus of hiding the implementation of file storage from the client app. So you can implement the server side to do practically anything you want, and change it going forward without having to do too much work on the client to adapt.

The amount of work might actually be even in both cases, depending on the language you are using.
 
Thank Krevnik,

With the current implementation, I have a problem:
+ Sometimes, the client successfully write data files on mounted server folder (I can view it from client side); but these files are not presented on Server.

( I guessed that the Server was in "sleep" state when the Client wrote files to mounted folder, so I set the Server's automatically sleep to "never"; however I'm not sure about this)

Do you know what causes the problem about?

PS: The server's running Snow Leopard, and Client's running Tiger)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.