2 Replies Latest reply on Mar 20, 2009 10:01 AM by Dustin69

    SQL to FLEX over the Internet

    Dustin69 Level 1
      Hi all

      I'm looking for some advice on the technologies I should be looking at for getting data from SQL Server 2008 into my Adobe Air application. I'm not a programmer by trade but do have some experience in VB, C# and now Actionscript/MXML & .NET. I'm getting on really well so far with Flex Builder but have reached the stage where I need to grab data from a SQL box over the Internet. I've had limited success with WSDL, being able to return single variables but encountering a known Flex bug when trying to generate the classes required for pulling in .NET data tables or datasets. Based on the following criteria, can anyone point me at the technologies/areas I should be looking at?

      1. Back end server - currently a single Windows Server 2008 Standard with SQL 2008 Standard and IIS. Intention is to separate and provide redunancy by using a clustered pair of SQL boxes and separate IIS servers to host the SOAP services.
      2. Client - running Adobe Air, will need to authenticate using a locally stored username and password. The authenticating server should also perform checks on client IP address.
      3. All communication between client and server should be secure.
      4. On first connection to the server, the client will be required to read in around 10 small tables, the largest of which having up to around 500 rows of String variables (i.e. no large image/binary data to worry about)
      5. Thereafter, the client will need to check-in for updates as frequently as possible - at least once every 15 seconds. Updates would often be 0-10 rows and never more than 200.
      6. Potential to scale up to around 2000 clients.

      If you have any questions please ask away. From what I've read so far, WSDL might be slow and inappropriate. I've seen Enterprise Services mentioned but not really sure what that is yet. Must do some more reading.

      Any help and direction, URLs for further reading etc. greatly appreciated.

      Thanks in advance, Dustin.
        • 1. Re: SQL to FLEX over the Internet
          ChrisKStuart
          Consider encoding data into AMF format before sending to client. This benchmark compares many data communication approaches, best performance was achieved with AMF (Select "Flex AMF - 5000 Rows" from dropdown):
          http://www.jamesward.com/census/
          "The Flex AMF benchmark makes a RemoteObject request to the server for 5000 rows. The server serializes the data in the AMF format. AMF is a binary object format for ActionScript objects in the Flash Virtual Machine. The client gets the AMF data over HTTP, shoves it into memory, then updates the DataGrid with the 5000 rows. The DataGrid supports client side sorting.

          Results:
          Out of all the benchmarks AMF is by far the fastest and smallest across the wire. There is nearly no parse time because the objects are already AS objects (instead of XML or another text based object representation). Render time is also extremely fast due to Flash's, Mozilla Tamarin JIT'd VM. If you try sorting you will again see the performance of the VM. Notice that sorting is faster in the AMF benchmark than in the E4X benchmark because the objects are typed AS objects rather than XML objects."

          This post contains AMF benefits and example code:
          http://flex.sys-con.com/node/468744
          • 2. Re: SQL to FLEX over the Internet
            Dustin69 Level 1
            Thanks Chris, am learning fast here. Currently playing with WebORB which looks like the kind of thing I might be after. Any other recommendations welcome.