Skip to main content
July 21, 2009
Question

How to speed up the CF - database interaction?

  • July 21, 2009
  • 2 replies
  • 1609 views

Hi,

Let's say we've got a front-end (in Flex or cfml) which needs to monitor some kind of real-time data (e.g. data that changes every second or millisecond) and that we've got to do some kind of manipulation with this constantly changing data (calculations, etc) to output a result and also insert or update certain tables in a database (e.g. MySQL 5.1).

Is this feasible using CF? Or, should I say, is this advisable to do with CF? Or which is the best programming language (and database) for that matter (especially in terms of performance)?

How can we speed up the GUI to-and-from Database interaction?

I mean apart from indexing tables or using stored procedures?

Thanks in advance and best regards,

Yogesh Mahadnac

This topic has been closed for replies.

2 replies

Inspiring
July 21, 2009

From what you have said, I would separate the database updates from presenting the report to users.  For the former, run a scheduled job at an appropriate interval.

For the latter, put the data stuff into an iframe and meta refresh it at the appropriate interval.

July 22, 2009

Hi Dan,

Many thanks for your reply.

Let's say the data is changing every millisecond.

Wouldn't it put too much load to run a scheduled task every millisecond (I don't even know if this is feasible) and at the same time refreshing the iframe?

Thanks and regards,

Yogesh Mahadnac

Inspiring
July 22, 2009

Just because the data changes every millisecond doesn't mean you have to refresh the view every millisecond.  In fact, if it changes that quickly, you will never show current results.  You will always show a snapshot as of when the query started.

The appropriate interval is something you should discuss with the people who want to see this data.

ilssac
Inspiring
July 21, 2009

ColdFusion could provide a part of the solution for such an application.  But the common use case of ColdFusion providing HTML interfaces built from data stored in Databases, text files and other locations would not provide what you are looking for.  The problem is that with normal HTTP communications there is no common or easy way for a server to push data to a client that it sounds like this type of application would need.

If you are looking for an Adobe based solution you would probably be looking at a Flex or Air based client that could make use of the Life Cycle data services to receive data pushed from the server over AMF channels.  ColdFusion could provide a middle layer between the Flex|Air client and the database back end.  But this would not be a common type of application built by most developers.  You are going to be in exotic waters here not traveled by many of your fellow CF types.

July 22, 2009

Hi Ian,

Many thanks for your reply.

I'm not conversant with the Life Cycle data services but I'll definitely have a look into it.

My only issue is, how effective would be?

I mean, performance-wise, wouldn't it put too much load if the data is changing constantly e.g. every millisecond?

Do you know of any alternative solution, even if it's not CF-Flex-based?

Thanks and regards,

Yogesh Mahadnac.

ilssac
Inspiring
July 22, 2009

As Dan aludes to in his reply there are several parts of this type of application and they are going to have different timing requriements.

You are going to have the data collection and storage peice.  I presume this is someting outside of ColdFusion because I can not imagine an HTTP based web application receiveing data every millisecond.

You are going to have a data report interface that looks at the state of the data at a given moment.  This will not be changing every millisecond.  Human don't operate that fast.  This report will receive a snapshot of the state of the data on different intervals depending on the nature of the report.

You are going to have somekind of interface that connnects the Report user interface with the data backend.  This is the ONLY place ColdFusion would really fit into this type of application.  It is not the only possible choice.  Java, .NET, PHP, etc are all capable of providing a middle layer between the database and the user interface.