What would be the AWS equivalent to Firebase Realtime Database?
<p>I'm working on a new game project at the moment that will consist of a React Native front-end and a Lambda-based back-end. The app requires some real time features such as active user records, geofencing, etc.</p>
<p>I was looking at Firebase's Realtime Database that looks like a really elegant solution for real-time data sync but I don't think AWS has anything quite like it.</p>
<p>The 3 options I could think of for &quot;serverless&quot; realtime using only AWS services are:</p>
<p><strong>Option 1: AWS IoT Messaging over WebSockets</strong></p>
<p>This one is quite obvious, a managed WebSockets connection through the IoT SDK. I was thinking of triggering Lambdas in response to inbound and outbound events and just use WebSockets as the realtime layer, building custom handling logic on the app client as you typically would.</p>
<p>The downside to this, at least compared to Firebase, is that I will have to handle the data in the events myself which will add another layer of management on top of WebSockets and will have to be standardized with the API data layer in the application's stores.</p>
<p>Pros:</p>
<ul>
<li>Scalable bi-directional realtime connection</li>
</ul>
<p>Cons:</p>
<ul>
<li>Only works when the app is open</li>
<li>Message structure needs to be implemented</li>
<li>Multiple transport layers to be managed</li>
</ul>
<p><strong>Option 2: Push-triggered re-fetch</strong></p>
<p>Another option is to use push notifications as real-time triggers but use a regular HTTP request to API Gateway to actually get the updated payload.</p>
<p>I like this approach because it sticks to only one transport layer and a single source of truth for application state. It will also trigger updates when the app is not open since these are Push Notifications.</p>
<p>The downside is that this is a lot of custom work with potentially difficult mappings between push notifications to the data that needs to be fetched.</p>
<p>Pros:</p>
<ul>
<li>Push notifications work even when app is closed</li>
<li>Single source of truth, transport layer</li>
</ul>
<p>Cons:</p>
<ul>
<li>Most custom solution</li>
<li>Will involve many more HTTP requests overall</li>
</ul>
<p><strong>Option 3: Cognito Sync</strong>
This is newer to me and I'm not sure if it can actually be interfaced with from the server.</p>
<p>Cognito Sync offers user state sync. across devices complete with offline support and is part of the Cognito SDK which I'll be using anyway. It sounds like just what I'm looking for but couldn't find any conclusive evidence as to whether it is possible to modify, or &quot;trigger&quot;, updates from AWS and not just from one of the devices.</p>
<p>Pros:</p>
<ul>
<li>Provides an abstracted real-time data model</li>
<li>Connected to Cognito user records OOTB</li>
</ul>
<p>Cons:</p>
<ul>
<li>Not sure if can be modified or updated from Lambdas</li>
</ul>
<br/>
<p>I'm wondering if anyone has experience doing real-time on AWS as part of a Lambda-based architecture and if you have an opinion on what is the best way to proceed?</p>