Dhravya / dump.place

Home Page:https://dump.place

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Faster queries

Dhravya opened this issue · comments

The database read/writes are very slow,

Query speeds can be improved using

  • a complete rewrite of the db to redis
  • more efficient queries

Is migration to Redis a good decision, how's the performance now and can also add pagination(infinite or pages) in the home page to improve performance.

I think we only need to optimise the write operation, so a complete migration isn't worth it

Hello there @Dhravya and @anuragts , will a rewrite to redis be worth it, asking because will you be okay with the fact that the data will be ephemeral? not sure about your plans for the continuous usage of the app. Sorry for randomly joining the conversation, my name is aaron, I am looking for ways to contribute to the project soon, please be expecting my draft pr/proposal soon.
Cheers.

@kenneropia data in redis is not always ephemeral (see https://github.com/lmfao-tech, where all the posts were stored in redis!) a TTL of infinite can be set to redis databases

Really nice to see that you want to contribute! I have some issues open, for eg #16

Okay, thanks. I appreciate. I will signify as soon as I am ready.

actually, let's not rewrite it to redis, we need ways to make it feel faster now, that's it.

  • caching on the home page
  • showing the dump before it's published and then revalidating the path

stuff like that should do it I just added pgbouncer for the database and ever since then everything has been working slightly better

  1. Regarding this, would you recommend using Redis, the newly built cache function that comes with React/Next, or a regular in-memory library? Also, what would be the recommended Time-to-Live (TTL) and the length of the dumps to be cached?

  2. By this, are you referring to something like optimistic updates? I observed that you are using server actions; you can make use of the new userFormStatus or startTransition to monitor the form submission status and eliminate some queries in the server actions function.

Does this align with your thoughts and plans? What would you suggest?

Cache function with NextJS would work, don't want to overcomplicate things

and yes, optimistic updates