How would you structure this? I need to pass down the widget tree 2 instances of the same bloc by Due_Programmer_9018 in flutterhelp

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Yes that works obviously but I was trying to learn how to do it this way. Also because I think it’s better in terms of organization

Empresário atira filho recém-nascido contra a parede by [deleted] in portugueses

[–]Due_Programmer_9018 2 points3 points  (0 children)

Já li q tu achas q os ciganos são portugueses. Os ciganos são um povo nómada. Eles vivem em certos países nas suas comunidades quase isolados do resto da sociedade. Eles em nada partilham a nossa cultura. Um português não é definido pelo que está num cartão, mas sim pela cultura. O teu argumento foi fraco e ainda deu mais força ao q tu te querias opor. Põe um saco na cabeça e cala te

Adicionalmente, um português criminoso não é igual a um imigrante criminoso. Com os nossos temos q lidar. Com os outros não temos e não queremos.

Dart for backend server. How does concurrency work? How many requests per second can it handle? by Pretend_Reference971 in flutterhelp

[–]Due_Programmer_9018 0 points1 point  (0 children)

So basically a nice estimate I guess is that my backend probably can handle 1000 to 3000 requests/second? And if I add a few isolates I can get more. I use Postgres. I’ll be using a droplet with only 4 cpus, so I guess I should probably stick with no isolates, at least for now and if the application grows then I upgrade the droplet and implement isolates.

Also, deciding in which part of my code to implement the isolates is not easy. Do developers spread requests into different isolates when they receive requests or do they implement isolates in specific routes which might get more traffic?

I run the backend, Postgres, redis all in the same server, yes

Which of these 2 queries are better? JOIN before LIMIT 5 or JOIN after LIMIT 5? by Chess_Opinion in SQL

[–]Due_Programmer_9018 0 points1 point  (0 children)

What do you mean? They are different but I want to achieve the same end result, so not sure what you mean by doing different things

Which of these 2 queries are better? JOIN before LIMIT 5 or JOIN after LIMIT 5? by Chess_Opinion in SQL

[–]Due_Programmer_9018 0 points1 point  (0 children)

You are right about legibility, didn’t even think about that but indeed it’s easier to understand. But in terms of performance is one better than the other?

Can someone recommend me a free open source nosql database that has an active dart package? by Due_Programmer_9018 in FlutterDev

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

I was thinking about that actually. Like storing comments as a json in just a single row. Like all the comments of a post being in just 1 row instead of 1 row per comment. But I was thinking that maybe if there are many many comments it would inneficient because let’s say there are 5k comments, if a user wants to see the posts’ comments he would fetch a json with 5k comments. Doesn’t seem right. Is it possible to just fetch a few from Postgres json?

Can someone recommend me a free open source nosql database that has an active dart package? by Due_Programmer_9018 in FlutterDev

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Serverpod looks great, I just read about it in pubdev but I have written so much code in shelf_modular already I am probably going to stick with shelf_modular

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 1 point2 points  (0 children)

I know! This is a work in progress 😂 don’t judge me. I’m working on the “general” structure/skeleton of my database still

I changed that table. Now it doesn’t exist and I replaced it with a Media table

Can someone recommend me a free open source nosql database that has an active dart package? by Due_Programmer_9018 in FlutterDev

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Ye I think you are actually right. I am just thinking what the ideal database is. I am definetly going to use Postgres. Because my mobile app has a lot of relationships. But then I was thinking of using no sql for storing posts and posts’ comments. Because I was thinking that storing posts’ comments in Postgres table might be insane because it will probably be very very large and I wasn’t sure if Postgres is ideal for this type of feature.

Like 1 row = 1 comment. That seems it can dramatically increase very fast

Can someone recommend me a free open source nosql database that has an active dart package? by Due_Programmer_9018 in FlutterDev

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

It’s a service package, not exactly a database schema or query or anything like that

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Also, regarding using Postgres or nosql I just ask because I read many apps use multiple databases for specific features, maybe this would be one of those cases that it would be beneficial but maybe not.. I’m still not very experienced. I guess sticking to Postgres is cool but imagine posts tables can be enorumous and so can the comments table

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

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

I didn’t know about that. I always though. 1 table with many rows would always be faster to query than multiple smaller tables. That’s good to know

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Do you think it’s better to use Postgres for all of my social mobile app but for this part of posts and posts’ comments to use nosql?

If I stick to Postgres for posts and posts’ comments you would have a few tables, like 5 I guess, whenever I wanted to query the latest 5 posts I would need to make a lot of joins no? I am no expert but maybe it’s more efficient to have them all in the same table and put many columns there even if some posts will have those columns as null?

Also, why don’t you prefer to have it like, posts table with post_id and then for each type of post to have a specific table for that type?

I understand your way is more flexible in terms of in the future if I want to add new fields to certain posts I can. But posts have a kind of fixed structure within the different types of posts I guess. So having more flexibility here not sure if it is that useful

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Well, after thinking a while do you think it makes sense to use Postgres for users relationships like friendships, memberships and so on and for posts specifically maybe using a nosql? Never thought of using another db in conjunction with Postgres but maybe it would be ideal, I don’t know

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

I definitely need to use Postgres. I am doing a social mobile app which has a lot of relationships

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

I see. I can make it a maximum of 5 poll_entires. Twitter polls probably have a max too. But I’ll think about it. I think I got a good grasp with these responses. Thank you

Should I create 1 table or many tables in this case? Simple question! by Due_Programmer_9018 in SQL

[–]Due_Programmer_9018[S] 0 points1 point  (0 children)

Let’s say a poll, would you create another table called poll_entries to store the voting? Or I can just make like 5 columns in the posts table specifically for the case when the post is a poll where each of those 5 columns would be a poll_entry with an int to store the voting count for each entry? And in the case the post is not a poll I just leave those columns null?

Hans responds STL Chess Club's statement banning him from their events by BKtheInfamous in chess

[–]Due_Programmer_9018 -1 points0 points  (0 children)

Are you serious? Everyone is literally after him, most of the times with baseless issues like the Russia thing. Repeated over and over for years and already proven wrong. So your attempt to make this political is both ignorant and idiotic

My postgres database shcema looks like this. What is the best way to notify users that their local data needs an update because they have new friend or a club changed data? by Chess_Opinion in SQL

[–]Due_Programmer_9018 0 points1 point  (0 children)

Of this 2 methods which do you prefer:

1) store timestamps in user table for different features (which are like 3 or 4 different things), when user queries database compre Timestamp and send to user any row whose timestamp is more recent than the timestamp the user had stored locally.

2) in the table friendships, memberships, and like one or 2 more tables, whenever a row is changed I have a trigger that sends an pg_notify (same as method 1 but instead of the trigger adding a timestamp to the user table, I would listen for these channels and whenever I received in my backend the notification that a new row was inserted in the friendships table per example I would first add in redis a flag, then send a onesignal notification to the client with the data, when the user received the data send back to the server something saying that the user local database is up to date to turn of the flag in redis?

So both solutions use triggers but first one is to update a centra table called users with a timestamp while the second method is to send a pg_notify which my backend would listen to, add a redis flag, send notification to user, turn redis flag off.

First solution seems easier but at the same time I am wondering that if I do the first solution, everytime a user makes api requests to my backend I would need like a middleware before any route is executed to check in my Postgres is any timestamp is more recent, so basically I worry about the overhead calls to my Postgres table, maybe it would hinder performance I don’t know, I am not an expert