Fork me on GitHub
#asami
<
2023-12-19
>
Dave Mays11:12:04

Does Asami give you any built in mechanisms to help you keep the front and back end synchronized? I'm not smart enough to implement CRDTs or anything like that so was wondering if it had any automatic syncing help?

quoll12:12:44

It doesn’t really have synchronization issues, being an “in-process” library. As soon as a transaction is committed then it’s available. Until then, no writes are accessible except from within the writing thread. If there are any cases where this isn’t happening, then it’s a bug and I need to track it down

quoll12:12:35

Or are you asking about something else and I’m missing it?

Dave Mays14:12:17

Oh I was just curious if it had any helpers for automatically keeping an in-browser instance synced with a server side instance.

quoll15:12:16

Browsers aren’t set up for this yet because the query API has to be ported to promesa before I can do it. Right now, all read operations need to be synchronous, which obviously won’t work for the browser.

quoll15:12:24

Writes are fine. They can be sent to the back-end, cached at the front end, and the write operation can be ignored until it’s over.

quoll15:12:10

So long as the block keys are kept unique, then even if a transaction is corrupted, it can be ignored (though you may want to track down all the received blocks and remove them)