Max number of alerts?

Is there a maximum number of simultaneous alerts that can be set via the API using /SetAlert? What about a maximum number of alerts over the lifetime of the account (seems like the alert_ids are 32 bit integers)?

My server sets FlightXML alerts for flights that users are tracking with my upcoming iPhone app - one for each unique flight ident/tail# that is currently being tracked. It’s conceivable that there could be thousands of aircraft being tracked at the same time, and I’d like to know whether your system can handle that or if there’s a hard limit of a few hundred, for example.

Along the same line, is there a maximum number of alerts that will be returned by /GetAlerts?

Thanks!

There’s no specifically enforced alert count limit when using SetAlert, but you are charged for each event that gets triggered as a result of an alert. We don’t anticipate reaching the integer limit of alerts anytime soon, but if we do then we will probably revise many of the other structures to be 64-bit.

GetAlerts does not have any specific maximum that it can return, but it will eventually begin to timeout if you have too many alerts configured. Deleting alerts before they become too numerous will limit this problem. Also note that alerts are automatically deleted by the system if the end_date is passed. We highly recommend that an end_date be specified when possible, since it reduces burden on your side to delete them to clean them up. We will eventually introduce a GetAlertsEx that provides paging functionality and also ability to query based on a specific alert_id, or other search criteria in the alert.

Thanks for the information. That was very helpful.

When you say /GetAlerts could timeout if there are too many alerts, I anticipate an upper limit of up to a couple thousand at a time. Do you think that is likely to cause a timeout when calling this method?

I’m currently vacuuming alerts on my own (calling /DeleteAlert) when the flight for which the alert is set is old (landed >3 hrs ago) or when none of my users are currently tracking flights with that ident. I also have a cron that checks for orphaned alerts periodically. I didn’t think to use end_date, but for me that might complicate things since I’m re-using the same alert for multiple flights (ones with the same ident) and figuring out which users to notify based on the faFlightID mentioned in the alert callbacks.

I like the ideas for GetAlertEx, and look forward to seeing that appear in the API.