Hi Guys, I’m trying to find a way to see live data in my web application/mobile hybrid application, is there a way to do this? I don’t see any information regarding live data in the docs.
What I want to implement is that when a new record is added or updated in airtable, the web app somehow detects the change in the airtable data and update the view. I saw that we can use airtable.js and airtable.browser.js if you’re using it in the browser, but what are the differences? cannot find anything related to airtable.browser.js, anyway, going back to the main problem, is there a way to display the data as live as possible?
Real-time updates into web pages require a definition since [presently] Airtable doesn’t provide webhooks or event handlers in the API. These are necessary to create truly responsive integrations. Lacking these features, we must poll for changes.
While integration services like Zapier claim to support an event-like behavior (i.e., a new record is added and near-instant updates are processed), they are only mimicking an event-like behavior. I believe Integro requires you to add date/time fields to expedite the polling nature of this objective by limiting tests against tables based on recent polling intervals.
When you say “live data”, you should qualify this by narrowing down the latency your users are willing to tolerate.
< 5 minutes
< 1 minute
< 10 seconds
< 1 second
< 100 milliseconds
Many users think they are getting live data when it’s never older than 5 minutes. Others, such as the transit center in Los Angeles hold my company to a much faster standard when a bus driver is attacked - 500 milliseconds to be exact. A camera has to recognize the attack and report the event in less than 1/2 second to be considered “live data”.
In any case, it’s a good idea to consider the latency tolerance before choosing any specific implementation approach.
Let’s assume by “live” you mean updates should appear on the web page in less than a minute.
This is not ideal because timer loops – in general – are fairly brittle machinery for the web. They are not impervious to each client’s available memory and other environmental conditions. And with each look, Airtable.js must make a new call to the Airtable API to see if anything has changed in the target base/table.
Ideally, you need a real-time architecture for data updates and synchronization to the browser. Indeed, in a real-time climate the objective is to simply synchronize the data between the table and the browser web page. This is best achieved with sockets - a technical concept that sustains an open connection between the browser page and the database.
Firebase is famous for this capability and I use it often to achieve near-instant replication of data from servers and disparate services. Another technology that makes this possible is PubNub, a real-time data streaming network. Depending on the nature of the application you are building Firebase and PubNub may be overkill, but they are both near-free (and free at lower tiers of volume).
In my view, the most reliable and less brittle way to achieve what you want to do is to try to eliminate as many moving parts as you can. Airtable.js certainly achieves this - it is a single client-side SDK that talks directly to the Airtable API.
Feel free to describe your desired latency and scale of the app and I’ll put a finer point on this topic.