kyurkchyan
kyurkchyan

Reputation: 2428

Does realm database support blazor web assembly?

I have an ambitious goal to build a cross platform app that would share as much code as possible that would run on desktop, mobile devices and web browsers. The application is going to use realm database with mongoDB atlas for cloud sync.

All of those nice offline-first, automatic sync capabilities are available for desktop and mobile devices. I wonder if I’d be able to use the same for blazor web assembly?

Let’s say it’s not possible, what alternative could I use as database? And what could I do to implement real time sync with mongoDB realm cloud database on blazor as a fallback?

Upvotes: 2

Views: 650

Answers (1)

Nikola Irinchev
Nikola Irinchev

Reputation: 2186

Neither the Realm Database, nor Realm Sync can run in the browser at the moment. The team has plans to explore Wasm as a potential target, but there's no definitive timeline for that yet.

In terms of workarounds, you could use GraphQL or the Web SDK both of which expose an API to query MongoDB via an HTTP API. One edge the Web SDK has over GraphQL is that it supports watching a collection for changes, whereas GraphQL only has Query and Mutation support. With both of these solutions, you'll need to design your own caching/storage layer.

Upvotes: 3

Related Questions