Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Client/Server application sharing memory - no Database

Status
Not open for further replies.

Tilen2

Programmer
Jun 10, 2007
2
SI
Hi

I need some advice if I can convert my desktop application into client server app...

My app reads some files and creates a memory data structure and offers very powerful analytical functionalities.

It is very memory consuming app, meaning it can take up to 800MB+ ... but because of this, it is very very powerful and fast with analyzing the data.

So, on some really big files or some a bit old PCs, it can be a bit too much to handle.

So, I was thinking of creating a server app, which would run on a server, every morning it would load the necessary files and offer to clients just to get analytical results.

Servers usually have lots of memory and lots of processing power, so it can be very useful.

Now, the thing is that this kind of server app would also allow for other users to access the same data, without running locally the app, taking their own resources.

So, is this kind of server app to share memory data to several clients, at the same time, actually possible?


A database version is out of the question!


Can I get any tips on how to start, or if somebody already implemented such an environment, and what could be the flaws of it?

Another benefit would, the time that my app loads a file/s.. which sometimes take up to 10 mins... so clients would benefit from not spending time to load, not taking memory resources and since the server app would always be up and running, they can access it anytime, without waiting to 10 mins load...

Please, I need advice if this is viable and how hard it is to achieve it.

Thanx

 
When you talk about sharing memory, what you really mean is sharing the results. This can be done quite easily. A simple database would be ideal - I'm not sure why you want to resist it. Your server app writes the results to a table or number of tables, and then the clients can use Excel or Access or you could write your own custom app and they can easily retrieve/refresh their results each morning or whenever.

A database is the easiest way to do what you want.

If you're determined to be stubborn however, you can still do what you want using a TCPServer and TCPClient. I've had a fair bit of experience using the Indy components. Essentially you add a TidTCPServer to your server app, which waits until a connection is made from your client app's TidTCPClient component, and then you can pass data between the two applications in the form of Strings or data streams.

You'll want to attach code to TidTCPServer.OnExecute and TidTCPClient.OnConnect. Keep in mind that any code that runs in OnExecute will be in it's own thread so you'll need to do some reading up on how to use multiple threads safely (eg. no writing to global vars).

Get yourself started and post back with more questions.
 
Thanx for the answer.

Yes, the database is still out of the question.

For now, I just needed the confirmation if it is possible sharing the results. Thanx for pointing me into right direction with TCPServer/Client.

I will start working on proof of concept in next two weeks, so I'll definately have more questions.

Thanx a lot, for now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top