Embed YottaDB via WASM

96 views
Skip to first unread message

Noel da Costa

unread,
Apr 13, 2021, 6:27:58 AM4/13/21
to Enterprise Web Developer Community
Hi all,

Has anyone tried / succeeded in embedding YottaDB into a client-side application via something like WASM?


Thanks,
Noel

Sam Habiel

unread,
Apr 13, 2021, 9:12:01 AM4/13/21
to enterprise-web-de...@googlegroups.com
Not as far as I know; a significant challenge is that there are about
100 files in YottaDB that are in assembly already. I presume these
have to be re-written for WASM.

--Sam
> --
> You received this message because you are subscribed to the Google Groups "Enterprise Web Developer Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to enterprise-web-develope...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/enterprise-web-developer-community/983e2ab2-9ffa-4117-9c25-e18a7d5e1d8cn%40googlegroups.com.

K.S. Bhaskar

unread,
Apr 13, 2021, 9:43:45 AM4/13/21
to Enterprise Web Developer Community
Noel –

Is this primarily a “would be nice to have” feature, or is there an application need that you can articulate? If you prefer to reply off- rather than on-list, my e-mail address is bhaskar at yottadb dot com. Thank you.

Regards
– Bhaskar

Noel da Costa

unread,
Apr 13, 2021, 10:23:24 AM4/13/21
to enterprise-web-de...@googlegroups.com
Hi Bhaskar,

Primarily there are two things I’m thinking about:

1. IOT
2. Offline first

In Africa and other developing parts of the world and even just in general, it’s useful to be able to use an app offline, which syncs for multi-user persistence when online. There are technologies that handle this: firebase, pouchDB / couchDB are two examples. 

I’m designing an application presently which benefits hugely from the hierarchical speed of YottaDB but it can only be used online and it’s the kind of app that would be very useful offline also. So I’m looking at how this can be facilitated.

I also did a little bit of research into how something like YottaDB could be compiled into a blockchain – but without success. This could also be a big growth area – most blockchain data are limited to key/value pairs with no hierarchical data being possible.

Happy to pick this up privately if we need to get into my application’s specifics but maybe still useful publicly here for now.


Cheers,
Noel


-- 
You received this message because you are subscribed to a topic in the Google Groups "Enterprise Web Developer Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/enterprise-web-developer-community/cQqEJV6qCuo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to enterprise-web-develope...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/enterprise-web-developer-community/433f2531-3ba9-4776-9e7e-88ee6e6dfcedn%40googlegroups.com.

Rob Tweed

unread,
Apr 13, 2021, 10:33:45 AM4/13/21
to enterprise-web-de...@googlegroups.com
I’ve created, but not yet published, an example of a secure offline app which uses indexDB in the browser and which automatically updates the QEWD-JSdb database when online. The real trick is the security piece, since the databases embedded in the browser are wide open.

With some funding I’d be willing to make this available for others. I’ve not seen anything similar out there in terms of the security solution 

Rob 


Sent from my iPhone

On 13 Apr 2021, at 15:23, Noel da Costa <noeld...@gmail.com> wrote:

Hi Bhaskar,
You received this message because you are subscribed to the Google Groups "Enterprise Web Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enterprise-web-develope...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/enterprise-web-developer-community/3EC23D64-CFED-4786-A06A-BDE98D66B29A%40gmail.com.

K.S. Bhaskar

unread,
Apr 13, 2021, 11:19:52 AM4/13/21
to Enterprise Web Developer Community
Noel –

Where is the persistence when running in the browser? Is it in the memory of the browser so that all data lost if the device is turned off? What sort of OS does the browser run on, and in turn, what sort of hardware does the OS run on?  Thank you.

Regards
– Bhaskar

winfrie...@e-ntwicklung.de

unread,
Apr 13, 2021, 1:34:45 PM4/13/21
to Enterprise Web Developer Community
Perhaps MQTT is your solution? Even made for IoT, modern Web-2.0-applications use it too.
It is especially made for weak (and perhaps down) networks.
With Quality of Service (QoS) you can be sure all your messages will arrive
- zero or one time (QoS 0)
- at least one time (QoS 1)
- exactly one time (QoS 2)
There are libraries like eclipse paho (Browser, embedded-C), mqtt for node (and with nodem you have easy access to YottaDB), myself i wrote a connector based on mosquitto-C-Library
to connect to YottaDB.
For ESP / Arduino there are MQTT-libs too, so sending IoT-data to YottaDB (or fetching from)  is quite easy....

But paho in Browser is pure JavaScript not WASM... Why WASM?

K.S. Bhaskar

unread,
Apr 16, 2021, 1:29:32 PM4/16/21
to Enterprise Web Developer Community
Noel, please do tell me where the persistence is in the model you have in mind. Thank you.

Regards
– Bhaskar

Noel da Costa

unread,
Apr 16, 2021, 4:20:23 PM4/16/21
to enterprise-web-de...@googlegroups.com
Hi Bhaskar,

The idea is that the server will handle long-term persistence.
The device needs to be able to persist data during periods where the app is offline.
Ideally data on the device should survive a reboot, the way Local Storage does.
Once online, the device syncs with the server.

Cheers,
Noel



Noel da Costa

unread,
Apr 16, 2021, 4:23:57 PM4/16/21
to enterprise-web-de...@googlegroups.com
The target OS would ideally be – all of them.

iOS
Mac OS X
Linux desktop
Android
Windows Desktop

… because the app effectively runs in the browser.


Cheers,
Noel

Rob Tweed

unread,
Apr 16, 2021, 4:26:18 PM4/16/21
to Enterprise Web Developer Community
Noel

It would be a lot simpler to just use IndexedDB which is already there in the browser.  I'm not sure what you believe is the advantage of using YottaDB in the browser



You received this message because you are subscribed to the Google Groups "Enterprise Web Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enterprise-web-develope...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/enterprise-web-developer-community/A668BBE1-EBC9-4659-8A09-3CAEF2C993DD%40gmail.com.


--
Rob Tweed
Director, M/Gateway Developments Ltd
http://www.mgateway.com

Noel da Costa

unread,
Apr 16, 2021, 4:29:21 PM4/16/21
to enterprise-web-de...@googlegroups.com
Hi Rob,

I’m not sure if there’s an advantage, my thinking was simply that if one uses Yotta on the device that syncing to the server would be easier as the data structures are identical. Wrt IndexedDB or Local Storage, I’m not sure whether or not it can handle similar structures. Seems to me one would have to write the persistence code twice, once for Indexed and once for Yotta.


K.S. Bhaskar

unread,
Apr 17, 2021, 1:36:37 PM4/17/21
to Enterprise Web Developer Community
Noel –

Running entirely in the browser, one would of course lose data if the device went down. But it can be done – there's some programming involved of course and there would have to be a business case. In your application, is running on something like a Raspberry Pi Zero (if not that specific hardware, basically a 32-bit ARM running Linux using a MicroSD card or other inexpensive flash memory for storage)?

In any case, you may find a couple of pages from our web site interesting. They are a few years old, but still relevant:


Let's keep the discussion going.

Regards
– Bhaskar

K.S. Bhaskar

unread,
May 5, 2021, 2:26:56 PM5/5/21
to Enterprise Web Developer Community
Noel –

John Willis was able to bring up the VistA electronic health record application up on YottaDB on a PinePhone (screenshot below). With such an application, it can operate off-line, and whenever it gets a data connection, all database updates can be replicated to a server in the cloud. If the device is powered off, or just crashes, data is fully recoverable.

Does something like this meet your needs?

Regards
– Bhaskar

E0lhXcDVUAEJiOR.jpg

Noel da Costa

unread,
May 6, 2021, 4:02:29 AM5/6/21
to enterprise-web-de...@googlegroups.com
Hi Bhaskar,

Yes, that’s sound useful. I hadn’t heard of PinePhone – Google says it’s linux, which I can imagine is easy to build YottaDB for – but I mean who uses a PinePhone right? I’d be looking to get it working on iPhone and Android.

The other part of it though it multi-user sync – a database isn’t much use if it only supports a single user. i.e. multiple users should be able to sync data with the same cloud storage address. So I guess the question is whether there is an existing sync mechanism or whether that needs to be manually built in something like Qewd?

N

On 5 May 2021, at 19:26, K.S. Bhaskar <ksbh...@gmail.com> wrote:

Noel –

John Willis was able to bring up the VistA electronic health record application up on YottaDB on a PinePhone (screenshot below). With such an application, it can operate off-line, and whenever it gets a data connection, all database updates can be replicated to a server in the cloud. If the device is powered off, or just crashes, data is fully recoverable.

Does something like this meet your needs?

Regards
– Bhaskar

K.S. Bhaskar

unread,
May 6, 2021, 10:00:07 AM5/6/21
to Enterprise Web Developer Community
Noel –

The fact that it runs on a PinePhone means it can run on Android or iOS, with some porting effort (probably minimal for Android). Two way sync is not built in to the database, but way back when I wrote some code for a demo (https://sourceforge.net/projects/fis-gtm/files/Plugins/GTMPeerRepl/0.1/) that can be adapted with some minimal effort.

Regards
– Bhaskar
Reply all
Reply to author
Forward
0 new messages