View
62
Download
5
Category
Preview:
Citation preview
Serverless Computing
● No worrying about underlying infrastructure and hardware choices
● Scale Automatically
● Save $$$
Various Options In BaaS Spectrum
Cloud Service Provider ManagedLess Flexible
Self ManagedMore Flexible
FaaS:ServerlessFirebase Functions
IaaS:VM
KubernetesPaaS:App EngineHeroku
Firebase
Traditional Approach: ID Provisioning
function editTask(taskId, change) { fetch(`/task/edit/${taskId}`, ...) // ...}
app.post(‘/task/add’, (req, resp) => { db.add(req.body) .then(id => resp.send(id));});
latency!
latency!latency!
function addTask(task) { fetch(‘/task/add’, ...) .then(taskId => { // ... // ... });}
Without taskId from server, cannot call editTask
Realtime Updates: Bad Approach
setTimeInterval(() => { fetch(‘/tasks’).then(resp => { ... });}, 100);
Very Inefficient!
How We Use Firebase
● Authentication
● Security - Firestore Configs
● Firestore
● Firebase Functions
Frontend
Firestore
Fast Real-time sync
Firebase Functions
Push Events to
Potentially slower due to cold start
Real-time data sync won’t be blocked by slower analytics data collection.
Recommended