Integrated Application Platform › Forums › General › Client/Server file access › Re: Re: Client/Server file access
Basically, it is just access to the database (e.g. queries) that is client-server. It is similar to using other database servers like MySQL. One difference is that Suneido loads the program code from library tables in the database. Another difference is that Suneido packages the client and server into a single exe.
Database triggers run on the server. Rules may also run on the server if their result is required e.g. for a query.
If you use File to access an operating system file, that happens completely on the client. The current directory will be the client’s.
If you want multiple clients to access a file, then you need to store it in a shared directory that everyone has access to. And it is better to use a UNC path (e.g. \servercshared) (rather than mapping a drive letter) so that the path is the same for all clients. (You can put suneido.exe in the same shared location and set up client shortcuts to use it. This makes it easier to update the exe.) This shared location can be on the same computer as the server is running on, or it could be a separate file server.
Normally, it is sufficient to run your code on the clients. For special cases it is possible for a client to use ServerEval to run code on the server. But you have to be careful with this because if you run something that blocks, then you will block the entire server and all other clients. An alternative is to run an HttpServer as a client, but on the same physical machine as the server, and then use it to run anything you need executed there. Also, if you do this kind of thing, you need to worry about concurrency e.g. multiple clients running something on the server at the same time.
Note: Suneido’s use of client-server is designed for local area networks. It uses many small requests. If you try to run it across the internet, even with high bandwidth, latency will make it very slow.
Does that answer your questions?