Questions tagged [mysql]

MySQL is an open-source, relational database management system.

Filter by
Sorted by
Tagged with
0 votes
2 answers
100 views

How to handle time differences in MySQL

I'm facing a problem with handling different timezones in MySQL. I have looked into similar questions that were previously raised, but I couldn't find a proper answer. The issue I'm encountering is as ...
Prasad Darshana's user avatar
3 votes
3 answers
158 views

How to reliably determine changes in a DB table since some sort of "checkpoint"?

My scenario is fairly typical, but I can't figure out a good solution. I have a DB table (in reality several unrelated tables, but let's focus on one) where there is a fair deal of activity going on. ...
Vilx-'s user avatar
  • 5,320
3 votes
2 answers
402 views

Is it a good practice to have two unique IDs for an SQL-Database?

Currently I want to create a SQL database effectively and "logically". Lately I read a lot about the issues that it is (mostly) not a good idea to define primary keys that can be seen from &...
Vito's user avatar
  • 55
15 votes
9 answers
8k views

Can it be acceptable to construct SQL queries dynamically?

I know that as a general rule, you shouldn't construct SQL queries dynamically because of the possibility of SQL injection. However, it could come in quite handy to break this rule and define for ...
Thomas's user avatar
  • 185
1 vote
2 answers
221 views

Is it a good idea to design a database based on the API response data types?

I am trying to design my database, where i have to save some response data given from an external api as a webhook. This api will return me as well “referenceId” as an identifier, which i will use ...
user avatar
9 votes
4 answers
4k views

How to store a fixed length array in a database

I have a mysql database in which I have drafts, each of which contains exactly 24 players the order of which matters. I am conflicted between having a drafts table with 24 extra columns for each ...
RobbyG's user avatar
  • 101
-2 votes
2 answers
105 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 ...
ste's user avatar
  • 7
-2 votes
2 answers
56 views

How to serve customized content to each user, based on targeting criteria?

In my PHP Laravel application, I want to display special offers to users, depending on the quality of their house(s). There are 4 Models: User, House, Offer, OfferTargeting. Each User can have many ...
Tim Kohlen's user avatar
1 vote
0 answers
90 views

Backend Design: System requires both ElasticSearch and MySQL. In which scenario we fetch data from MySQL or ElasticSearch?

So, one of the backend system, having 5 resource types (tables) and some foreign keys as well, requires full text support for two of the tables. Also, for some use-cases, we require inner-joins for ...
Bugs Buggy's user avatar
1 vote
0 answers
302 views

Design MySQL database to store user workout data for Workout App

I am building a fitness app and I'm trying to figure out the optimal way to store the data is a MySQL database. I would like to have specific programs (for example, 'get jacked'), I would like a users ...
adherb's user avatar
  • 121
-3 votes
1 answer
53 views

Server performance and CMS scalability [closed]

I have been given the job of a colleague who has resigned and I don't know where to start. I hope you can give me some hints: It is about a CMS made from scratch (Javascript/jQuery/PHP/MySQL) which ...
ADM's user avatar
  • 97
0 votes
2 answers
93 views

Transferring data from 1 web app into another offline

I have a web app that will be used locally on 2 different site. The program is a Vue web app made with node.js and express, using MySQL database. Due to limitation (no internet in site 1), there is no ...
Aditya D.'s user avatar
-1 votes
1 answer
92 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; ...
tihiyev's user avatar
  • 11
-2 votes
2 answers
182 views

Avoid redundant field using JSON type in MySQL [closed]

I have experienc with designing relational dbs but first time attempting to store JSON in a mysql table. I am using mysql 5.7.8 which has the ability to store json data type as a column. When I create ...
simgineer's user avatar
  • 139
-1 votes
1 answer
1k views

Locking a DB table and waiting for writing/reading it from a web application

I'm working on a web application using Spring (Java and JPA + Hibernate) and I was wondering if there is a way of locking a MYSQL table and then when another web service (or even another thread from ...
Jordi Pagès's user avatar
1 vote
1 answer
1k views

Implementing transactional entity lockouts with Spring and JPA

Spring Boot/Java 8/MySQL here. I have a widgets table in my MySQL DB that is modeled by a JPA entity like so: @Entity @Table(name = "widgets") @Data public class Widget { @Column(name = ...
hotmeatballsoup's user avatar
-2 votes
2 answers
142 views

Database Structure for The Best Efficiency

I want a database table that can hold all of the group chat messages from all of the group chats. The max amount of users per group chat would be 20. The max amount of group chats per user would 25-...
TheAdmin's user avatar
0 votes
1 answer
65 views

Database schema for two different types of elements on map

I wrote a software for a customer that shows clients on a map (Google Maps). I store the clients on a table on the MySQL database (table clients) and show them on the map using markers. Each clients ...
Gianluca Ghettini's user avatar
4 votes
5 answers
2k views

How can you ensure order of execution in concurrent tasks?

Here is what I am specifically doing: I have a thread-safe queue One 'write' thread constantly writes to the queue with data that comes from another service Multiple 'read' threads take from the ...
ulak blade's user avatar
0 votes
1 answer
356 views

Database normalization for grade management system

I am working on a grade management system web app for a university and I came up with this database schema How the app work: In the user table I am going to keep all the users data and the ...
tibi's user avatar
  • 21
-4 votes
1 answer
281 views

Design a login system

I have a task of designing login system with the requirement below: If the user login over three times, lock account for the first 5 minutes. The next failed 3 times login-in will lock the user ...
kungho's user avatar
  • 101
2 votes
3 answers
284 views

Is it best practice to always try to return a minimum number of rows from the database?

First-time poster so please be gentle :) I have a rather large table in my database (MySQL in case it matters) that holds lat/lng values of certain points of interest around the world (table name: ...
Arj's user avatar
  • 131
0 votes
0 answers
117 views

Fill Docker Container from existing remote database

I do have n nodes managed by Kubernetes, all of them running several containers. A container may contain a database alongside with an application. As containers should be stateless, all data within ...
Bin4ry's user avatar
  • 101
0 votes
1 answer
216 views

Variable WHERE clause while avoiding sql injection

I want the user to be able to provide a custom WHERE statement against a mysql-backed platform... do I need to worry about any possible SQL injection attacks notwithstanding invalid sql? See the ...
Sanchke Dellowar's user avatar
15 votes
6 answers
12k views

Should I use DATE or VARCHAR in storing dates in MySQL?

Simply put, I have date and time attributes on an Orders table. The data types for these attributes are MySQL's DATE attribute. But everytime I echo the date and time in PHP it just gives me a string, ...
mizstereo's user avatar
  • 215
0 votes
0 answers
46 views

What is best approach to designing a local-to-cloud cloud-to-local Infrastructure?

I plan to have a cloud web application(CWA) and several local web application(LWA), let's assume 3 LWAs and 1 CWA. CWA === LWA. This web application would consist of a database server, file storage ...
Olamide226's user avatar
2 votes
0 answers
57 views

Scaling Order Management System for ecommerce

Tech Stack: I am using MySQL 8 with InnoDB engine. Application is built using Java with Spring & Hibernate. Database is hosted in AWS RDS and web apps in EC2. I have two primary tables for ...
Abhinav's user avatar
  • 259
-2 votes
2 answers
224 views

What's better, using DB or Storage services to save videos?

I am creating a website that allows to teachers to uploading courses, what's better, to just use the DB or should I use storage services, and how could I know the size of the videos? I am using AWS if ...
Elzubair Mohammed's user avatar
-1 votes
1 answer
655 views

Best practice to flatten JSON object and store it database

I'm fetching data from Clockify, flattening the JSON response, and storing it in the database where each property on the API response should have its own table's field. I have read this article about ...
Danish's user avatar
  • 113
0 votes
1 answer
162 views

Does it make sense to have redundant DB fields to improve query performance, programming speed and code readability?

I am a bit torn about the database design for a solution. I have the following structure: (only the relevant fields are marked with #) +------------------+ | activities | |------------------| | ...
Aridez's user avatar
  • 119
0 votes
1 answer
481 views

Is deterministic SELECT possible without specifying an ORDER BY?

When we show a table with many thousands of records, we only show a small part of the total result set so as not to send too much data to the client at once. Clients can request more parts of the ...
user2180613's user avatar
  • 1,752
0 votes
0 answers
79 views

DataBase Design for frequent delete operations

We have a use case wherein we want to store incoming data and invalidate all the previously existing data pertaining to one parent entity. ie Parent p1 --> has List< child> old_data ( already ...
vipulk10's user avatar
-3 votes
2 answers
161 views

Does DigitalOcean offer enough resources to run a scalable MySQL cluster?

I have a Kubernetes instance from DigitalOcean that has 2 worker nodes and 1 load balancer. Now I want to create a MySQL managed database cluster for the app that will run on that Kubernetes. Question ...
emma's user avatar
  • 133
0 votes
2 answers
110 views

How can you avoid doing hundreds/thousands of queries when utilizing classes in PHP?

I have been dipping my toes into object orientated PHP programming and I'm finding it useful but I can't help but feel I'm missing something in regards to how to utilize it. Normally my classes and ...
Connor Martin's user avatar
-3 votes
2 answers
50 views

Does it make sense for a large scale SaaS project to use a single all powerful SQL/RDBMS database?

Scalability seems to be a thing now. I was in a heated argument with one of my developer who insist on using MySQL for a data intensive application we are building. MySql is easy, fits the purpose and ...
user1034912's user avatar
1 vote
2 answers
155 views

Appropriate database schema

I'm currently collecting the data about flat prices. I have size, price, location, price per m2 and date of retrieving the data about flat(sample date). I'm plannig create MySQL database filled with ...
viceriel's user avatar
  • 121
1 vote
0 answers
53 views

Best way to integrate google signin in existing user registration system with PHP/MYSQL [Logic]

I want to integrate google signin, in our existing user registration system. But not sure which approach will be good in terms of data security + user experience (UX) + speed. Even if its a good idea ...
mimi's user avatar
  • 111
18 votes
1 answer
6k views

Is it possible/advisable to combine unit testing and integration testing?

I've built a Python script that consists of about 20 functions that extract data from MySQL via .sql files (I'm currently trying to learn SQLAlchemy ORM), do something to it and then put it back in ...
Jossy's user avatar
  • 311
0 votes
4 answers
742 views

Is it reliable to compress database backups with git?

I'm working as an intern at a fund. I spent the last month building a website for internal use, and now I think it's a good time to set up a backup scheme for the MySQL database at its backend. Funny ...
nalzok's user avatar
  • 549
1 vote
0 answers
188 views

Should I decouple MySQL database?

I have two sites, one is a subdomain of the other. They both do different things entirely with one unifying goal. My intent is to have the main site do a majority of the heavy lifting, and the ...
shiafisher's user avatar
0 votes
1 answer
371 views

Database dictionary table versus code defined enum

For the following table structure, for the metric_id column, what are the advantages of having a JOIN dictionary table versus an ENUM dictionary defined in the code? Assuming the metrics dictionary is ...
Dunams's user avatar
  • 9
2 votes
2 answers
6k views

Is it okay to keep open the MySQL database connection open through out the Application or open and close connection query-wise?

I'm developing a REST API using Nodejs along with MySQL as the database.Is it okay to keep open the MySQL database connection open through out the Application or open and close connection query-wise ? ...
Pasindu Dewapriya's user avatar
0 votes
0 answers
46 views

Drag and drop and handling huge amount of documents to update position

I'm having a series of data as documents in a document db (CouchDB) Sample of a document looks like below { _id: xxx _rev: xxx data: xxx position: 1 } These documents displays in a web front-end ...
inckka's user avatar
  • 129
0 votes
1 answer
153 views

Implementing a user ID system like Discords for a web app using Java Spring, JPA, Hibernate and MySQL

I’m trying to create a web application with a forum and user profile along with other functions. However I’m thinking about how I might implement an ID for each user. The best way I’ve seen other ...
SneakyShrike's user avatar
-2 votes
3 answers
362 views

How should I store file history in a MySQl data?

I am creating a web app with JS and PHP where users can edit a file similar to a text editor such as notepad. I've decided to use a database to store these files. One of the primary functions of a ...
Jack's user avatar
  • 103
0 votes
0 answers
48 views

Architecture to check for user properties in bulk?

We run an infrastructure in our organization, where a list of configs are provided and we check which config a given user satisfies. For eg: config_1 = {"a": 1, "b": 2, "c": 3} config_2 = {"a": 1, "b"...
user2077935's user avatar
0 votes
2 answers
357 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 ...
Kwsswart's user avatar
  • 139
-1 votes
1 answer
88 views

Best practices for creating structured data from "flat" SQL query results

Recently I've been working on a project to teach myself PHP and SQL, and as the project has gotten more complex I've been wondering what the idiomatic approaches are for creating the backend models ...
Jumhyn's user avatar
  • 162
2 votes
2 answers
1k views

Chat part of application - using UDP or TCP?

I'm trying to build a section of my app where two users can message each other. I've read about TCP and UDP and it seems like TCP is more suited due to ordered packet delivery. However, TCP requires a ...
Callum's user avatar
  • 121
-2 votes
1 answer
378 views

Which Software Architecture am I using? XAMPP, Apache, MySQL, PHP Android

I use XAMPP to host an Apache web server and a MySQL database. Most of the data processing is done on the user's mobile phone. After a certain activity, information of the user is sent to the web ...
santa's user avatar
  • 1

1
2 3 4 5
11