All Questions
21
questions
0
votes
1
answer
64
views
How to handle concurrently caching expensive request data in postgres?
I have a kubernetes deployment which is fielding expensive (but cache-able) requests, let's say a website scraping service (not really) which takes about 15 seconds to scrape a website. In my backend ...
1
vote
1
answer
171
views
SQL - store "like" counts as separate column or infer from a query?
Say I have a feature in a web app where users can create a post and like it. In the frontend the user should see the number of likes a post has.
I could store the data two ways:
1. Option 1: A small ...
0
votes
1
answer
93
views
Am I making this web app right?
I am currently making a newsletter website that will send you a email with the top ten manga for that week. Currently I have a web scraper that retrieves the top ten along with descriptions and other ...
-2
votes
2
answers
157
views
How to filter and concatenate multiple sql files into one database [closed]
I have an issue where I have multiple databases from previous projects that I would like to combine into one large database. These databases are stored in .sql files. The issue is that I only need ...
2
votes
4
answers
2k
views
HOWTO: Full-text search over an encrypted database?
I want to adhere to the best practices and obviously encrypt the data sent to me by user. And I also want to provide the full-text search feature to the user (user can only search their own data, if ...
2
votes
1
answer
54
views
SQL: Analytics event value that can be string or number
I'm using a PostgreSQL database and I want to create an analytics table that has a many-to-one relationship with an analytics_type table where analytics_type_id is the foreign key. The table also has ...
-1
votes
1
answer
107
views
Commit instead of rollback? [closed]
Simple example (PSEUDO CODE):
for (int i = 0; i < 100; i++) {
START TRANSACTION;
SELECT id, name FROM employees WHERE id = i;
IF (someFunction(id)) {
ROLLBACK;
...
2
votes
2
answers
261
views
What is the best practice for hierarchical container - item relationship in a SQL database?
I am in the process of designing a database organizing real world items in different storage locations.
One main principle is that items can contain other items.
So the relevant table is:
An "...
0
votes
2
answers
486
views
Is it true that ORM allows for changing the type of SQL that you use easily?
Hey so I have been looking into ORM since my last question and I am wondering.
Instead of worrying alot right now about whether I will use mysql, postgre, or sqlite, would it be better to use ORM ...
0
votes
1
answer
1k
views
Doing data manipulation on server side vs client side
Im building a project that stores time series data on a per user basis. On the dashboard of the user it'll show some simple statistical analysis like averages but more importantly, it'll create charts ...
-3
votes
2
answers
915
views
Database Schema for a multiplayer quiz game
I'm trying to accomplish this scenario :
There are 2 types of users, let's say Admin and Worker, and there have different roles.
Admin can do a CRUD of questions, and also can create a room where ...
1
vote
1
answer
731
views
I need Auto-incremental like key but how?
I have a business specific pattern for storing their IDs. It's in the format of yy-mm-autoincrement.
I could just store date and incremental id but there's another problem. It should be restarted ...
1
vote
1
answer
92
views
Database Schema design of server running status log
I am working with 4 AWS EC2 instances (servers). Each Instance has Instance ID and Instance Name. Instance ID is unique. Each of them having multiple application servers, like on of them is running ...
1
vote
2
answers
70
views
Proper way to track ranking evolution of some db records
I will have a database of products where each record will have a number associated with it, let's say, the number of "sales".
I will periodically update the database so each "sales" field for each ...
2
votes
1
answer
624
views
Scaling resolution of time series data
I built an app that display time series data. The display is very similar to a yahoo finance chart (ie https://finance.yahoo.com/quote/AMZN/). I am using Postgres to store the data because that was ...
-3
votes
1
answer
390
views
Is SQL inefficient since it has to parse through everything?
As you know SQL doesn't have arrays. So if you make a table "article" and wish to have comments on your articles I presume you would make another table "comment". Inside "comment" table you have the ...
4
votes
2
answers
468
views
Database constraints for a recursive folders structure
In an application, I have a recursive folder structure (like folders in OS X or Windows file system).
Each folder can contain three kind of things:
Other folders (hence the recursive structure)
...
7
votes
3
answers
550
views
Do common relational database systems work 'out of the box'? [closed]
I'm quite new to software development and whenever I come across small projects which involve storing (relational) data I always ask myself if something like a micro-blog (or any other project with ...
1
vote
2
answers
84
views
SQL - for some attributes specific to different clients' users, how to handle schema?
I have clients, each of whom have an app with a bunch of users.
Their user data could be pretty different, but there is also a lot of overlap. Ex: all their users have "gender" and "age" and plenty ...
7
votes
4
answers
11k
views
What is the "correct" way to store functions in a database?
Note: Yes, I know that storing functions in databases should be punishable by law.
We are developing a financial web application using PostgreSQL, Sinatra and AngularJS. As you may have guessed, a ...
3
votes
1
answer
2k
views
Established coding standards for pl/pgsql code
I need to standardize coding practices for project that compromises, among others, of pl/pgsql database, that has some amount of nontrivial code.
I look for:
Code formatting guidelines, especially ...