1 Reply Latest reply on Feb 24, 2009 4:06 PM by Joe ... Ward

    AIR application acting as server

    nickdima
      I want to develop an AIR application that will need to work both standalone and in a client-server environment.
      I'm talking about a books library management application that needs to work in both scenarios:
      1. as a standalone application in libraries that have only one computer
      2. in a client-server environment for libraries that have two or more computers
      Most of my clients will have only one computer so I'm thinking that using the built-in support for SQLite provided by AIR will be the best, time-efficient solution. On the other hand what do I do in the second case? Is there a solution to create an AIR server application so that the client applications will connect to it and use its SQLite database, and if so, is it feasible?
      I'm aware that I can use a database server but I'm thinking that would complicate things on the coding side and also, keeping in mind that the majority of my clients have just one computer, it will be kind of complicated to have them install the application and also a database server on the same computer.
      So what do you think? What solution will work best for both scenarios? Thanks!
        • 1. AIR application acting as server
          Joe ... Ward Level 4
          AIR applications cannot currently act as a server.

          Your options are probably:
          a) Use Flash's new P2P service Adobe Flash Collaboration Service, which uses an Adobe-hosted service to initiate the connection.

          b) Write a native server (in Java, for example) that acts as communication hub between the master AIR client and any AIR clients on other computers. The drawback here is that the AIR application cannot start the native server, so you can't use the normal AIR install or launch methods. You would probably need to write a custom installer. You would also have to deal with network security yourself.

          c) Use a database and application or web server as a backend and an AIR client as the front end. For single-computer installations, the AIR client could store all data in its local database and you wouldn't need the server. When you add the server, each AIR client could keep a copy of the data, but also sync with the server when connected. You could probably find a lightweight and open source web and database server that's easy to install and configure.

          d) The same as c, but use a Flex or AJAX client in a web browser. It doesn't matter how many computers use your customers have. About the only thing that you'ld lose over an AIR app client is the ability for users to work in the app when the master database is not available (as well as a handful of other desktop-related features provided by AIR, of course).