How can you create an engaging real-time experience where you get hundreds, thousands, even millions of people to interact in a synchronized way? Well, obviously, with OutSystems mobile apps (and a little help from a Firebase realtime database)! In this session, we will talk about some of the best practices for building this type of experience and build a new experience live for everyone in the audience to play with.
12. | Real-Time Performed at Scale With Firebase + OutSystems
Need to keep everything / everyone
in synch within milliseconds?
13. | Real-Time Performed at Scale With Firebase + OutSystems
Need to keep everything / everyone
in synch within milliseconds?
● “Old school” approach of keeping everything in synch would be pooling the
server for updates every few seconds
● Better approach is to use a Firebase Realtime DB or MQTT to be notified of
updates but...still fetch data explicitly using synchronous logic
● Any of these still has a fair amount of latency and requires round trips
between client and server
15. | Real-Time Performed at Scale With Firebase + OutSystems
Messaging apps
or in-app chats
Build the next Skype,
Whatsapp, WeChat, Facebook
Messenger, Slack or simply,
add some cool real time
collaboration to your app
16. | Real-Time Performed at Scale With Firebase + OutSystems
Games or
Gamified Apps
Create the next competitive
real-time multiplayer game or
add some fun to your app with
embedded games and real-
time leaderboards
17. | Real-Time Performed at Scale With Firebase + OutSystems
Real time data
displays
Keep dashboards and data
everupdated for time critical
scenarios like stock trading,
energy grid measurements
or IoT data flows
19. | Real-Time Performed at Scale With Firebase + OutSystems
Architecture
How it works?
Firebase Firestore is a hierarchical
NoSQL database
Clients of a Firestore DB can
● write changes
● listen to real-time updates
● keep an offline cache
Communication / synchronization is
async behind the scenes using
websockets with gRPC protocol
20. | Real-Time Performed at Scale With Firebase + OutSystems
How is data
structured?
● Collections are top level
aggregator
● Data stored in JSON Documents
that belong to a Collection
● Documents can have nested data
structures and support most
common data types
● Data can be queried with filtering
and sorting
21. | Real-Time Performed at Scale With Firebase + OutSystems
Should I use Firebase RealTime
Database or Firestore?
22. | Real-Time Performed at Scale With Firebase + OutSystems
Firestore
● “New” recommended product
● Data broken down into
collections and JSON documents
● Offline for Android, iOS and
Web
● Indexed by default, decreasing
impact of size in query
execution
Real Time DB
● The “original” real time DB
● All data stored as a single, large
JSON tree
● Offline for Android and iOS
● No indexes, degrading
performance as data set grows
● Up to 200k connections
23. | Real-Time Performed at Scale With Firebase + OutSystems
Should I use Firebase RealTime
Database or Firestore?