7 votes
Accepted

High traffic website that shows users subscription status

Architecture Regarding this concern: Table where user's subscription status is supposed to contain is not complete. It has rows for very few users and the intent behind this whole exercise is to fill ...
Grajdeanu Alex's user avatar
6 votes

High traffic website that shows users subscription status

You may have heard the adage about separation of concerns, and that each function should do only one thing, and do it well. Consider the function ...
Kate's user avatar
  • 5,944
6 votes
Accepted

Summing categories of financial records per month in a query

Mixing Portuguese and English makes this code messy. Please pick one or the other. I recommend coding consistently in English, because Python, its library, and its code ecosystem are in English, so ...
200_success's user avatar
4 votes
Accepted

DB Class extending PDO w/ other useful functions

You didn't explain, in your question, what your objectives were with this class. Why encapsulate a PDO class like this? My guess is that you did this to put all your database functions in one place? ...
KIKO Software's user avatar
4 votes
Accepted

Postgres DB design

What probably stands out most is the foreign key in sh_staff_members which also functions as a PK. While inheritance seems like a better tool to represent the is-a relationship between sh_staff_member ...
Reinderien's user avatar
4 votes
Accepted

How to structure in handling websocket and inserting data to databse in Python

I find it unlikely this program works as expected. You have written approximately: Open a database connection, & assign that to client Get ...
AJNeufeld's user avatar
  • 33k
3 votes
Accepted

Database buffer class

Separate concerns Your class does two things: it interacts with the database and it implements a thread-safe queue. It would be much better to separate those two things. Create a ...
G. Sliepen's user avatar
  • 44.7k
3 votes
Accepted

function to group data by parent branches

Initial review points Before addressing the questions I have a few review thoughts: The code is readable and indentation seems consistent Type declarations can be added for the function arguments to ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes

Why are my read speeds so bad using sqlite?

At this scale I would not trust sqlite to perform reasonably, and would be motivated to switch to PostgreSQL. But in the more immediate term: Rather than load your IDs from a file into Python's memory ...
Reinderien's user avatar
3 votes

DB Class extending PDO w/ other useful functions

Given that all cosmetic suggestions were already given, I'd concentrate on rather critical flaws. Architecture-wise, such a class shouldn't exist. Technically, it is not even a class at all, but ...
Your Common Sense's user avatar
3 votes

DB Class extending PDO w/ other useful functions

Much of my advice can be found in https://www.php-fig.org/psr/psr-12/. The opening curly brace should be on the next line after the declaration. Method names should be camelCase. In most cases, I ...
mickmackusa's user avatar
  • 8,514
2 votes

Implementing a data extraction pipeline with Bash

I see some of this code is an earlier version of your similar question. Most of the points in the answers on that questions are relevant here too, let me just call out the highlights here: For ...
janos's user avatar
  • 110k
2 votes

Helper functions to get, set and remove from Firefox browser storage. Also, to get, push and remove from lists stored in the database

K.I.S (keep it simple) KIS is a super important concept to keep in mind when coding. Making code more complex than needed, often done in anticipation of probable needs, will make Development time ...
Blindman67's user avatar
  • 21.2k
1 vote

Is there any sugestions how to make this script faster if its possible?

Some quick comments: The function checkURL is called in a loop, but inside that function you close the Curl connection every time. Instead you could speed up ...
Kate's user avatar
  • 5,944
1 vote
Accepted

Efficient way to read files python - 10 folders with 100k txt files in each one

I created a few functions for quickly setting up a "test environment" of N folders each with M files: ...
Juho's user avatar
  • 3,569
1 vote

Movie library system

Now, I've really only looked at MovieLibraryCommandServiceImpl so far, and haven't looked at much of rest of the repo. Still, I have some comments on what I have ...
Sara J's user avatar
  • 3,160
1 vote

EF Core code-first "many-to-many-to-many" (Books with many credits with many people)

With your given model, the BookCreditPersonRelations found on Book would have multiple entries for the same credit, when you have multiple people for that credit. IMO, it's not how you'd give credits ...
Ε Г И І И О's user avatar
1 vote

A database trait in Rust. How can I make all these generic parameters easier to use?

For your intricate types I have found another approach: ...
Nonno's user avatar
  • 191
1 vote

Cleaning up nested promises in Cloud function

Didn't know of this community until very recently. There is an alternative approach to composite promises proposed on StackOverflow: Writing Clean Code With Nested Promises. There is also an ...
Ioannis Brant-Ioannidis's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible