Question

Je veux suivre quelques centaines, peut-être quelques milliers de personnes en temps réel.

Le mot Let que les aspects matériels sont triés et je peux obtenir les données dans une base de données.

Maintenant, je veux le sortir et le montrer, en temps réel.

... Weeeell temps "assez-réel". Disons que je veux dessiner un plan d'étage d'un bâtiment et terrain tout le monde tous les 1 à 5 secondes.

(je pourrais vouloir montrer que certains « types » de personnes au clic d'un bouton, je aurai besoin datamining, etc, mais collons avec le pire scénario).

Je suis assez à l'aise avec PHP, mais pas ce genre de chose. Personnellement, je serais plus heureux avec une application Windows code Delphi, mais la tendance semble être à tout faire navigateur basé.

Alors, la question, je suppose est de savoir si un navigateur peut gérer cela et si des arguments convaincants pour une via Windows ou d'une solution basée sur un navigateur.

Si elle est basée sur un navigateur peut gérer cela (afficher quelques milliers de points de données par seconde), et il n'y a pas d'arguments accablants pour les fenêtres alors je suppose que je vais aller basé sur un navigateur et d'apprendre quelques nouveaux trucs. L'avantage évident étant que je pourrais aussi réutiliser une grande partie de mon code pour (véhicule) suivi sur Google maps.

Était-ce utile?

La solution

Most of your work will probably be done in your spatially enabled relational database. For example, PostGIS can select data points within a bounding box or more sophisticated spatial predicates (ST_Contains, ST_Crosses, ST_Intersects, ST_Touches, ...) as well as the usual SQL joins and WHERE conditions. Spatial selects should use a spatial index to speed things up.

If this is the case, your app will largely be a presentation layer. In this case, use whatever will be easiest for you. The advantage of browser-based is that it is cross-platform client-server by default, but this might not matter to you.

With respect to render speed, it really depends on how you are planning to render your map. There are speed tests available for Google Maps. However, I suspect that if you are planning on a google maps type interface several thousand points are going to turn into a blur of pins. Do you have an interface mockup?

Autres conseils

If you'd be happier with one type of app versus another, then write that type of app. Don't make something a browser app just to make it a browser app.

First you should understand what is the target of your app (and its size, how many concurrent clients?), and then decide if a fat client or a thin/web one suits it best. Then you should check which kind of application is able to manage the load you forecast. Could you display a few thousand datapoint every second or so with the technology you master or can in your timeframe? Would multithreading help you to exploit current multicore processors to achieve your result? Which technology will let you take advantage of it?

Maybe seems a bit old hat, but if you do decide to go browser based, you could pre-render the points to an image and just show the image?

WebSockets

Take a look at HTML5 WebSockets, they are a new standard for server/browser data exchange:

WebSockets is a technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket, designed to be implemented in web browsers and web servers.

The server can push new data to the client when it becomes available, removing the overhead of client pull requests.

The Wikipedia page lists available server-side implementations, including PHP versions (but not Delphi).

WebSockets are not bound to JavaScript, the websockets.org page says:

In addition, the Web Socket protocol can be used to support a diverse set of clients (e.g. JavaScript, Adobe Flex, JavaFX, Microsoft Silverlight, etc.). However, the HTML5 specification only defines support for JavaScript, which is limited to text-based protocols. To serve other client-types and support binary protocols you will need to look to external offerings.

Message data can be exchanged in JSON format, which is supported by JavaScript and also available for Delphi (as open source implementations like SuperObject or lkJSON).


Ajax

Ajax based rich internet applications for Delphi can be built using Intraweb or ExtPascal. ExtPascal is an Object Pascal (Delphi, FreePascal/Lazarus) wrapper/binding for Ext JS, a complete GUI Ajax framework and offers transparent support for all main web browsers: IE 6+, Firefox 1.5+, Safari 3+, Opera 9+ and Chrome 2+ on any client side platform (PCs, SmartPhones, iPhone, PDAs, etc). Online demo applications: FishFacts, more.

Ajax Push (aka Reverse Ajax / Comet) offers "HTTP server push" of data (in XML or JSON format) which transfers data from the server to all connected web browser clients whenever data on the server changes. Clients can 'subscribe' to the information they are interested in.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top