2 Replies Latest reply on Feb 8, 2010 8:01 AM by MrFork

    Data Manipulation in Flex or On Server?


      Hello All,


      Im about to develop a very simple flex application which simply reads in some data from an SQL database and allows the user to filter and aggregate the data. In the past I have built the applications by loading all of the required data into flex first and then, using various filter filters I've built in actionscript applied these to the data.


      Another way to do this manipulation would be to create SQL statements based on user selection which can be passed to the scripting language to return the results.


      My question is simply - which is a better way around of doing things? Bare in mind that currently the data being fed into flex is small but is likely to increase over time.


      Are there any more efficient / easier to manage options out there? Any comments would be much appreciated.




        • 1. Re: Data Manipulation in Flex or On Server?
          Matt Le Fevre Level 4

          In the projects i've worked on i've always used PHP to sort the data required into the desired layout and then load it into flex, trying to keep the processing the flash does to somewhat of an absolute minimum.


          I imagine this to be the most efficient and fastest way of doing things, its major drawbacks being that it requires you to know additional languages.



          Having said that, things like the sort function in Flex have proved invaluable and at the end of the day simpler easier to use. Although i'd have no doubt that when handling large amounts of data it would be quicker to do it externally and then load it.



          For example, in one of my projects i have 1000xml elements being loaded with 10 attributes each. For the PHP to retrieve, format, default sort and then load the data into flex it takes about half a second. For Flex to then perform a sort itself on that data it takes ~2seconds.


          As this isn't much of a time issue i'll be leaving it as it is, as the amount of elements is never going to really exceed 1000 and the sort time is acceptable.



          If however there were going to be many more elements, i'd sort the data externally and read it in to reduce the delay.





          At the end of the day it all comes down to:


          How much of other solutions do you know about?

          How much time do you have to do what you're working on?

          How much data are you processing?




          All of which are in reference to the main question; Is it really worth it?



          Data manipulation can be much quicker if handled elsewhere, but is there any point in spending a week writing it externally to flex if you're only going to shave milliseconds of the end result time.




          Conclusion: It all boils down to what is acceptable to the customer, in an ideal world it would be a must, but unfortunately we are constrained about what is feasible.

          1 person found this helpful
          • 2. Re: Data Manipulation in Flex or On Server?
            MrFork Level 1

            Thanks for the response there, really helped me ensure that my development methodologies are correct for this project.