pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.48k stars 1.05k forks source link

Add electric-sql to the client-side-databases project to measure the performance metrics. #5589

Closed mattriese closed 3 months ago

mattriese commented 8 months ago

Add electric-sql to the client-side-databases project to measure the performance metrics.

For that, create an angular subproject like the already existing ones and then implement the logic interface.

I plan to be done with this on Feb 11th.

pubkey commented 8 months ago

Thank you @mattriese Let me write down a few notes that might help you:

mattriese commented 8 months ago

udpate: I would like another couple weeks to finish this.

pubkey commented 8 months ago

@mattriese No problems, thanks for the update.

mattriese commented 7 months ago

Update: I have a first pass at translating the logic to use electric-sql and setting up the scripts so the project will run. But the auto-generated typescript electric-sql client is being generated with many typescript errors, so it won't build. I asked about this in the electric-sql discord today but haven't got a response yet. If I don't hear back about that I will try manually fixing the type issues when I have some time this week.

How will I make a PR when it is working? will you grant me write access to this repo?

Also, when I try to run the projects in this repo and use them in the browser, only the Firebase projects works. And it only fully works in production mode. In dev mode it does not load the chat history, but I can add new messages. All the other projects get stuck on the loading spinner after I enter my name. (I haven't tried the AWS project because of the extra steps). I'm not sure what the problem is, but PouchDB, WatermelonDB, Dexie, and Loki all have an error on the server related to ng-cli-ws, like '"GET /ng-cli-ws" Error (404): "Not found"' PouchDB and WatermelonDB get the "user document not found" log in the client.

The e2e tests do seem to run fine, though.

pubkey commented 7 months ago

How will I make a PR when it is working?

Just make a single PR and I will merge it.

For your problems, maybe you want to clear the browser state in the "applications" tab in the dev tools. That might help. The projects build in the CI and the tests work, so it should be also working for you.

mattriese commented 7 months ago

The electric-sql folks have a couple PRs to fix the type issues, I will give it another try when those are merged and published.

pubkey commented 7 months ago

Hi @mattriese thanks for the update, lets wait for them to fix that.

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem. Notice that only bugs in the rxdb premium plugins are ensured to be fixed by the maintainer. Everything else is expected to be fixed by the community, likely you must fix it by yourself.

pubkey commented 6 months ago

@mattriese the PRs at the electric repo seem to be fixed/closed.

mattriese commented 6 months ago

Ah yeah, I just noticed they released it with electric-sql@0.9.5. I'll try to wrap this up this week

mattriese commented 6 months ago

I've created a draft PR to show my progress so far. There's a sqlite error when I try to load the app and the tests seem to have another problem. Any advice would be appreciated :) I'm hoping to hear back from the electric-sql discord channel about the sqlite error soon.

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem. Notice that only bugs in the rxdb premium plugins are ensured to be fixed by the maintainer. Everything else is expected to be fixed by the community, likely you must fix it by yourself.

mattriese commented 6 months ago

I solved one of the problems and narrowed down the cause of the other. see the new comments in the PR

If you have any wisdom around loading wasm files in a way that's compatible with Angular and testCafe, please let me know! :)

pubkey commented 6 months ago

@mattriese On some projects I am spawning a different server just to serve static files to testcafe browsers. I am not sure if that is the only possible solution. Maybe bundling the wasm file into a base64 is an option, but that might impact the performance results.

mattriese commented 6 months ago

@pubkey Ok thanks for the suggestions I will give it a shot

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem. Notice that only bugs in the rxdb premium plugins are ensured to be fixed by the maintainer. Everything else is expected to be fixed by the community, likely you must fix it by yourself.

mattriese commented 5 months ago

Update: I didn't get any responses to my question in the Electric-SQL discord about this issue. I tried the suggestion of spawning a separate express server just to serve the wasm files, and that did work in dev mode but when running the tests I got the same error (TypeError: cannot read properties of undefined. reading "durability"). I didn't try the suggestion of bundling the wasm into base64. Unfortunately, I have run out of bandwidth to keep trying to fix this bug. Maybe someone else can take over from here. I hope once the bundling/testcafe issue is fixed, it will be pretty close to being done. I'd be happy to jump back in if that problem is fixed and there are questions or issues with my implementation of electric-sql.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.

mattriese commented 4 months ago

@pubkey hey I just wanted to make sure you saw my last update on here.

pubkey commented 4 months ago

@mattriese yes I have seen it. There is no hurry, just ping me when you want to continue.

mattriese commented 4 months ago

Ok gotcha. I don't have any immediate plans to continue working on this by myself, but if I do I will let you know.

stale[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.

stale[bot] commented 3 months ago

Issues are autoclosed after some time. If you still have a problem, make a PR with a test case or to prove that you have tried to fix the problem.