MySQL is an open-source, relational database management system.
0
votes
3answers
158 views
How to write a proper class to connect to database in Java
I'm currently writing an application and I'm struggling with the decision of how to correctly design a class to connect to a database. I came up with something like this:
public class ...
0
votes
2answers
170 views
Need advice on making my own custom URL shortener?
Due to some issues with other shorteners like goo.gl (disabling my links for example) I want to create my own URL shortener.
I am looking to have a single table that will contain the following ...
0
votes
1answer
88 views
Transaction handling in DAO or Service layer in pure JDBC without frameworks
I have an application which works with pure JDBC. I have a dilemma where should transaction handling go, in Service or DAO layer. I have found that in most cases it should be implemented in Service ...
3
votes
1answer
88 views
What is an efficient design to store variables for different product lines in ER database?
This question is about refactoring existing database design.
My data flow is
User generates some data for product lines A, B, C
Data is saved into the database once
Data is later retrieved multiple ...
0
votes
4answers
129 views
How important is it to have multiple action per one page load?
In conventional web application there is single action per one button click from user. So clicking on submit form, send email or change status, delete user etc all this does single action per page ...
2
votes
2answers
80 views
Implementing count model in database
I've run into bit of an issue on implementing a count system in my project.
I have a system where users can like a post. Should I keep a count of it in the same table like
or should I remove the ...
1
vote
0answers
30 views
Cascade reference date through full query
I have created a complex query that references a specific date (year and month to report on) on numerous parts of the script. What would be the best artifact to have to only change 1 line of code and ...
-1
votes
1answer
49 views
Sql server to PHP (api vs library)
Our agency is currently using and maintaining the CMS we have developed in .net MVC on SQL server.
Since the cms is highly optimized and uses various cache tables to run very fast even with thousand ...
0
votes
1answer
88 views
Handle cron jobs for multiple timezone
How to handle cron jobs for multiple timezone?
I am working on the PHP project that supports users from multiple timezones. I have used multiple cron jobs for multiple database operations.
I am ...
1
vote
2answers
82 views
Storing user search terms
I have php application like airbnb. I want to store search values each time user search for listings.
my number 1 solution would be storing it in mysql table, but I'm not sure its wise to do, if site ...
1
vote
0answers
44 views
How to implement ETL with MySQL?
I have a legacy MySQL Database (A), and a new reviewed structure for MySQL data base (B).
Problem number one is that Database has to be alive and keeps receiving data from legacy apps.
What I need is ...
6
votes
3answers
112 views
How to enforce the mandatory participation constraint at the many end in a one-to-many relationship?
Say I have the following ER diagram:
Enforcing the mandatory participation constraint at the one end is easy, I simply make the foreign key (school_id) in Student NOT NULL.
But how can I enforce the ...
0
votes
2answers
81 views
Should MySQL database tables only have a single unit of information per row?
I run an automated data collection service at work, which records measurements (temperatures, voltages, etc) from about a dozen sensors at a rate of about once a second. The MySQL database table looks ...
1
vote
1answer
78 views
Converting a large PHP codebase from mysql_ to PDO [closed]
At my workplace we're soon going to be tasked with removing SQL injection vulnerabilities from a large code base. The application was originally written around 8 years ago and after years of bolt-ons ...
6
votes
3answers
226 views
How would you go about making a search algorithm for a CRM?
I know this question is kind of broad, but all I really need is some best-practice code structure or a link to a good tutorial.
I am working on a CRM that runs on php and mysql. Currently, our search ...
54
votes
11answers
9k views
Should I define the relations between tables in the database or just in code?
In my experience, many of the projects I have read in the past didn't have relationship definitions in the database, instead they only defined them in the source code. So I'm wondering what are the ...
0
votes
2answers
45 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 ...
1
vote
2answers
107 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 ...
-3
votes
1answer
82 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 ...
-3
votes
1answer
93 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 ...
0
votes
0answers
19 views
How should I structure an iPhone based offline Cache for OData?
I have an OData web service that I need to create an offline cache API for. This class will be leveraged by an offline-capable mobile client (iOS/Android/HTML5).
One option would be a class that ...
1
vote
2answers
79 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
145 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 ...
2
votes
1answer
87 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
92 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, ...
0
votes
0answers
122 views
Developing client-server application on top of Netbeans RCP
Our company is developing a large, database (MySQL) system on top of the Netbeans RCP. This is a Java Swing GUI based application.
We want to take advantage of Rich Client Platform to develop the "...
0
votes
0answers
12 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
85 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 ...
1
vote
1answer
322 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 ...
-1
votes
1answer
118 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 ...
1
vote
1answer
149 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 ...
1
vote
1answer
79 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
30 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
40 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
55 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 |
+----+---------+...
1
vote
1answer
102 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
124 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
52 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
248 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
246 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 ...
0
votes
0answers
120 views
Using an online database for multiple users to store their data
I am considering changing my wpf application to use a online database instead of a local XML file.
I have read some tutorials about binding data grids to Mysql database tables.
But what I don't ...
-3
votes
1answer
116 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 ...
-5
votes
1answer
296 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
60 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
vote
0answers
64 views
Dynamic Printing Options
I believe this is the correct community to post this question in, if not please point me to the correct one.
Overview:
Current web app gives users the ability to print labels from specific printers. ...
-1
votes
1answer
135 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
73 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 ...
0
votes
0answers
17 views
Updating user input based parameter in google search document
I am trying to implement rating system in google app engine and trying to use search API to maintain documents that has update rating. I will not use these rating to query but I want those rating to ...
1
vote
3answers
115 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 =
========================...
4
votes
2answers
111 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 ...