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 ...
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 ...
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 ...
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? ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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:
...
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 ...
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 ...
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:
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
database × 545c# × 104
sql × 98
python × 96
php × 87
mysql × 71
java × 65
object-oriented × 46
performance × 45
beginner × 39
sqlite × 25
django × 24
python-3.x × 23
javascript × 21
pdo × 20
postgresql × 20
sql-server × 19
c++ × 16
c × 14
entity-framework × 14
ruby × 13
design-patterns × 11
.net × 11
ruby-on-rails × 10
jdbc × 10