Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
185 views

Database Architecture - Comprehensive history of likes/shares/etc for all accounts?

The Setup This is a membership-based site. Each account is capable of: Making posts (unlimited, no restriction on frequency) Liking, sharing and commenting (on) the other posts The goal is to ...
2
votes
2answers
220 views

Multiple tables with same name, but each with a unique id to distinguish them?

I'm trying to code a dice game where users log in and then challenge each other. I already made a version of this game without login but only one game could be played at a time. So now, there will be ...
-2
votes
1answer
243 views

Is there any benifit to using a PHP class to handle MySQL queries?

I know several frameworks have this functionality built in where you can use their special methods to make DB queries. I also know this is (partially) to ensure that everything is handled correctly to ...
-2
votes
1answer
1k views

How booking system works

I want to do movie ticket booking and event ticket booking. In that how to avoid duplicate booking in short cuncurrency. I have five seats remaining in my event. Two user comes both will see 5 ...
1
vote
2answers
2k views

A good way to program for closing a long running MySQL connection and re-open it at intervals?

I'm running a Java application that creates 50 threads as part of a threadpool; each thread running in an object that reads 1000 unique rows at a time from a MySQL table. So each object has it's own ...
4
votes
1answer
260 views

How to parse events and pull specific events - triggers vs ad hoc queries

What is the best method to parse events in daily batches from external source (csv file) that produces entries in a separate table if any of a multiple of conditions are met. Conditions can vary ...
3
votes
1answer
1k views

Using messaging queue as async mysql writes

I read some articles about developers who takes rabbitmq and produce from PHP messages to write to mysql. they do this to make the page speedup and not wait for mysql to return an answer. So in my ...
-1
votes
1answer
127 views

Need help creating a database of map polygons

As a side project with my coworkers -- we are oil and gas geologists -- we have been creating an interactive map-based learning tool for other geologists. We are having trouble building the database, ...
1
vote
0answers
28 views

How to handle the set of objects that represents a context?

How can I handle the situation when exists the context that represents a collection of arbitrary objects? This context can be created by code like this: $context = new Context(); $context->add(...
3
votes
1answer
486 views

Do both the Server and Client program require a GPL when utilising a MySQL Database at only the server end

I'm building my first app and have reached a point where I'm considering switching to a MySQL database. However, I noticed the GPL on the Community version of MySQL. So I did some prowling and noticed ...
3
votes
1answer
6k views

Polling versus push notifications

I have a hybrid web app for android. The webpage or website the app shows is in asp.net. The javascript for the webpage running in the webview of the app is sending out an ajax request every 10 ...
0
votes
1answer
2k views

Big amount of text: database vs file

I have a web application with medium-high traffic where users can save designs made by fabricjs, so each saved design is a json with many parameters. So basically two days after launch users have ...
7
votes
1answer
4k views

Is indexing foreign keys a good practice?

Looking at DB tables created by a different developer I have noticed that whenever a table had a forein_key_id field/column, it was always an INDEX/KEY. I am not sure if it was manually created, or ...
4
votes
1answer
3k views

(Dis-)Advantages of storing objects in relational database?

In an off-hand comment on this question about storing PHP objects in a MySQL database I mentioned that it is probably not a good idea to do so. My reasoning is that MySQL is explicitly a relational ...
0
votes
1answer
212 views

Clan with members and admins Database Design

I want to create some clans in my game... And they can have some admins with some privileges... Am I need to create 2 tables one of them for clan info and one of them for clan members ?
2
votes
1answer
46 views

How to stage multiple queries

I am developing a reporting framework that requires multi-step calculations for numerous customers. An added complication is that customers have specific though similar methods of calculations. For ...
3
votes
1answer
70 views

Modeling a database for a heater domotic app

Imagine a domotic webapp, to command a heater. You could setup N plans, for a plan I mean a similar table: +----+---------+--------------------+ | id | name | target_temperature | +----+---------+...
4
votes
1answer
305 views

Storing in MySQL relationships between different type of objects

I have an app that needs to attach objects of different types between them. For example: I have to add Lead type object to a Contact type object , a Contact to an Event and so on. Such relationship ...
-1
votes
1answer
130 views

Is it ok to fire database queries again and again?

I am preparing a Java project and working on MySQL database. Currently I am stuck at a point where I want size of the resultset before I can actually fetch entries from it. The fetching of size is ...
1
vote
1answer
407 views

Why does MySQL slave receive two ROTATE events?

I am experimenting with the mysql-binlog-connector-java library for Java. When running sample queries and observing the sequence of replicated events I noticed that the ROTATE event is received twice (...
1
vote
2answers
3k views

Concurrent inserts to MySQL or write to separate tables and consolidate it?

I'm working on Apache Storm (but anyone who knows MySQL well could help too). Topology is like this: Single spout ----emit---> Multiple instances of a Bolt Each instance of the Bolt inserts a ...
1
vote
2answers
5k views

How should I setup a database for school management?

I'm struggling to set up a database to use in my School Academic system that is supposed to record all student's scores and then be able to prepare a report that shows students ranks. The hardest ...
-3
votes
1answer
354 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 ...
-8
votes
1answer
3k views

Insert data into database without using form

Do i insert the current directory files name into the database in PHP but without using the form??.. Because in my project a device send the pdf files on server's folder and i want to save these files ...
0
votes
1answer
116 views

Use redundant data in database design when have multiple relation

In my web application users can submit their advertises and buy package for advertise (packages are used for priority of showing advertises) Database schema is like this: **Package: id, title, ...
-1
votes
1answer
194 views

Php-mysql injection

<?php error_reporting(E_ALL); //ini_set('display_errors', 1); $db_server = "localhost"; $db_name = "2"; $db_user = "root"; $db_passwd = ""; $connection = mysql_connect($db_server,$db_user,$...
2
votes
3answers
128 views

Mirror data from SQL Server to MySQL on a computer with dynamic IP

Here is my problem, I have a task to create an android app to display data from our SQL server, the problem is our SQL server is not online. We have a MySQL server too, the MySQL server is online, so ...
1
vote
3answers
135 views

Updating all records in MySQL table while still available to the user

I have this 'table A'. It contains two columns; email and email_alias. A sample is below: ===================================== = email | email_alias = ========================...
3
votes
2answers
376 views

How to handle a one-time startup SQL script

I'm trying to figure out the best way to tackle running a one-time SQL script when a service instance starts up. Here's the scenario: We run multiple Amazon instances of our service in parallel. Each ...
0
votes
2answers
69 views

Should object enforce validation rules on read as well as write?

I have a class that enforces database-friendly formatting for some of its properties in the __construct() method. This guarantees that if a new object is created and saved, it will be saved correctly....
4
votes
2answers
145 views

Database design, processor vs inconsistency

I was wondering, if I have a table that stores, lets say, a user's transactions, then when I need to fetch the user's current balance I would have to go and use SUM() like SELECT SUM(value) FROM ...
4
votes
2answers
302 views

Possible performance issues implementing multi-tenant database?

I would like to design and develop school application using PHP and MYSQL as backend. The frontend - a combination of HTML, JS and CSS - has a registration form for every school. Every school has its ...
-2
votes
1answer
1k views

How to compare Sql datetime field with date field [closed]

I have datetime type column in sql tablename id createdand i get date from input date type html tag I want to compare in sql query where close condition. How to compare both field. var startDate = $('...
3
votes
1answer
121 views

Getting posts from users that are being followed: two different implementations

I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'l show you the tables, and then the two ...
1
vote
1answer
915 views

Question(s) about PHP PDO connections [closed]

Let's say I have a Db class [ db.php ] : <?php class Db { // class properties private $db_driver = ''; // dsn credentials private $db_dhost = ''; private $...
1
vote
3answers
1k views

Multiple items in a single column SQL

I'm creating a charter database structure. I'm trying to figure something out, I have read on here that databases should be normalized. Now, I'm a bit confused on this because I believe I have ...
1
vote
2answers
165 views

Are there downsides to not explicitly defining database relationships?

I have a PHP application with a MySQL database. I have not defined any formal relationships between tables. (eg. Set Foreign key, etc). Although in every query (CRUD) I always consider the relation ...
5
votes
3answers
8k views

How to test data based on SQL queries?

I'm trying to set up a test framework for (SQL) datasets that get updated daily. I want to write assertions that involve comparisons between two tables–for example, the sum of column visitors in the ...
3
votes
3answers
736 views

When dealing with tens of billions of rows in a web app table, would a NoSQL database be noticeably faster than a relational one? [closed]

I'm currently designing a conceptual web app, where users can submit posts, comments, and "like"/"dislike" both of those. However, I am not sure of how to store the (dis)likes, because of how many ...
1
vote
1answer
1k views

Which is better to call: API or Database?

I'm building a web app that hits up some APIs to get JSON dumps of data. I'm running across a problem. I can either grab all the data, dump it into a DB, then pull it from the DB as needed. OR I can ...
154
votes
3answers
61k views

Benefits of Structured Logging vs basic logging

We're building a new app and I'd like to include structured logging. My ideal setup would be something like Serilog for our C# code, and Bunyan for our JS. These would feed into fluentd and then could ...
0
votes
1answer
2k views

Generate id in application or use database generated one?

I am writing a small app that manages a couple of recipes. I have a MySQL database that is used by my data persistance layer. I need some kind of id in my business objects representing the recipes to ...
7
votes
2answers
9k views

How to sync the data from the same user across multiple devices

I'm working on a small fitness app in which the user (whom is authenticated with the a server) could create their own workout plan which will be synced with a server. The problem with this is that ...
0
votes
1answer
1k views

Saving an image in MYSQL vs saving to a folder [duplicate]

Is there an advantage to either method and/or a risk to either? Looking to upload JPG or PNG files only with a size limit of ~3mb with reduction done before insertion.
-1
votes
1answer
63 views

Querying Results from End of the table

Normal behavior of the SQL Table is to add new rows in end of the table. I want to query results of single row only. So mysql command is SELECT id FROM users WHERE country='india' LIMIT 1 this ...
8
votes
1answer
3k views

Using MySql 5.7 JSON columns for EAV

I am developing an e-commerce product and I have been able to implement all functionality and am left with allowing users to create additional attributes for a product. Right Now I have two options. ...
-1
votes
1answer
1k views

Migrating MYSQL functions and stored procedures to SQL Server

The company i'm working for is selling HRIS management software. It was built using ASP and mysql. But one of our client's demand is for it to be based on MS SQL Server. our team is made up mostly of ...
0
votes
1answer
435 views

Replace use of ComboBox with user controls

In currently developing a project where I'm going to use a lot of combobox, in order to avoid repeating a lot of code I'm planning on building a user control containing a ComboBox that retrieve the ...
1
vote
1answer
866 views

How to handle file uploads express (UUID / location)

I am building a community website with a NodeJS express backend and a mysql database. Now I am up to the point where I want to store profile pictures of users and pictures related to specfic questions....
11
votes
1answer
333 views

Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3

I am creating a 2d game for a website where the universe can grow extremely large (basically infinitely large). Initially, the universe is composed of 6 stars that are an equal distance from the ...

1 2 3
4
5
11