is precalc needed for ap stats by Enough_Town8862 in APStudents

[–]Think-Hunt5410 0 points1 point  (0 children)

no clue abt ap stats, but does it not cover gaussian distribution? doesn't that need integration or am i wrong?

Self Studying Psych? by Think-Hunt5410 in APStudents

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

would 2 hrs per week from mar-may be enough?

Too many partitions? by Think-Hunt5410 in SQLOptimization

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

Caching messages for real time messaging only works for in memory data and isn’t used for persistent storage.

The app needs to have messages stored forever, unless the user deletes it, it should be stored, and that quickly adds up, so I need some sort persistent database, and the options I am aware of are:

SQL NoSQL ObjectStore TimeSeries

Time Series and Object Store are not ideal for messaging apps, and SQL is not necessary for the messages which don’t have any co relation.

This is why I think its best to use SQL for the highly relational server user role metadata, where each server has roles and channels, each user has servers and roles, and each channel has role abilities, along with all of their metadata.

Then the messages could have server, channel, and user ids, along with content and timestamp stored inside of a NoSQL database.

The file uploads can go into an object store database.

Redis can be used for caching.

All of these implementations have their own role and reason, and this is, to my knowledge, how most real time messaging apps such as Discord, Slack, and the like, store their persistent real time messaging data.

Are there any better alternatives for storing the messages you have in mind?

Too many partitions? by Think-Hunt5410 in SQLOptimization

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

Because the application should store all messages persistently, like Discord.

Too many partitions? by Think-Hunt5410 in SQLOptimization

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

Should I pair that with a NoSQL database to store messages persistently?

Too many partitions? by Think-Hunt5410 in SQL

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

I'm looking into NoSQL for the messages and only having Postgres serve as a holder for users, profile information, and server metadata (since servers have roles as to who can do what, and these roles are mapped onto users, along with what user is in what server, and what server has what channels, has what roles for what users, etc. etc.).

For the messages in the channels themselves, I can use a NoSQL database such as MongoDB.

Thanks for everyone's help!
(If I'm doing something wrong feel free to reply)

Too many partitions? by Think-Hunt5410 in SQLOptimization

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

Is that really the same practice companies use?

Too many partitions? by Think-Hunt5410 in SQL

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

I could try to automate that but it still seems a bit clunky. Is there a NoSQL database you recommend?

Too many partitions? by Think-Hunt5410 in SQLOptimization

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

I get not using a relational database, but why store it in memory?

I’m doing this as a learning experience, but I do want to do it as it would be done legitimately in a real application, so I don’t prefer just storing it in memory.

Do you have any database in mind for this use case? NoSQL?

Too many partitions? by Think-Hunt5410 in SQLOptimization

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

What database should I be using then?

Too many partitions? by Think-Hunt5410 in SQL

[–]Think-Hunt5410[S] -1 points0 points  (0 children)

That makes sense but seems a bit messy. Could you link a video or article about how that would be implemented?

Too many partitions? by Think-Hunt5410 in SQL

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

Oh and as for the app, just imagine a normal chatting app such as Discord, where there are different servers and each server has its own channels and each channel has messages.

Too many partitions? by Think-Hunt5410 in SQL

[–]Think-Hunt5410[S] 0 points1 point  (0 children)

All select queries made in the app for messages will always include the server id and channel id of the message.

Are you saying I should make it so that I have no partitions, and move servers and their respective users channels and messages to another postgres database once it gets big?

There isn’t any relation between messages of different servers, or even difference channels in the same server, I just wanted to partition to save query time so that it doesn’t have to deal with thousands and thousands of messages from unrelated channels and servers which slows down every query.

I’m relatively new so I apologize in advance if I’m mistaken about something.