Questions tagged [mysql]

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

Filter by
Sorted by
Tagged with
3
votes
2answers
2k views

Do I need a web-service for this case? Data-synchronization over multiple clients

I'm new in this area and a little bit confused about my current thoughts on a web-service implementation for my application. I want to synchronize all connected clients with the current data on a ...
3
votes
2answers
4k views

SaaS model, 1DB per client

The context we're building a web-based system and one of the design decisions (database related) was whether to have 1 main DB manage all client data VS having 1 DB per client. After reading a lot ...
3
votes
1answer
8k views

Face Recognition(OpenCV) with MySQL and PHP

First of all I have asked this question on stackoverflow and got down vote for question being not belonging to the site. I am trying my luck se now(more suitable to se I guess) and I hope I will not ...
3
votes
3answers
2k views

Tracking time users spend on my website

We are going to track user engagement (i.e. time spent on website, most viewed part/page of the system, etc). I don't see Google Analytics / MixPanel being able to do this, since we have to analyze ...
3
votes
1answer
696 views

Voting System like Stack Exchange

I am trying to create a voting system like Stack Exchange. Should I create a table and insert values like following and then sum up the "vote" or there are some better ways to do this? Table name: ...
3
votes
2answers
2k views

Need to make a stock inventory application

I need to make an application for my dad to keep track of stock trading inventory. He trades shares for himself and for his clients and would like to keep the records, things like buy/sell price of ...
3
votes
1answer
4k views

How to store a matrix in a database

I am going to create a game that involves decision matrix's like the prisoner's dilemma. Much like the image below, except not necessarily symmetrical, and the values will change with each matrix I ...
3
votes
2answers
368 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 ...
3
votes
1answer
206 views

Should a stored proc try to do more, in the attempt to avoid php mysql back and forth overhead

I have a REST architecture, running PHP on the server side which store and query a Mysql database. I am re-evaluating one architecture design decision: DECISION to re-evaluate: In an attempt to ...
3
votes
1answer
641 views

Class table inheritance… To 'type' or not to 'type'

I currently have a database that uses Class table inheritance model. Three different tables inherit from this table. The child tables have all a FK to the parent table and the fields are properly ...
3
votes
1answer
123 views

MySQL setup for remote site failover

I'm designing a custom web-based inventory management and workflow system for a client of mine. One of their remote sites has fairly sketchy internet access, and needs to have no (or very little) ...
3
votes
2answers
2k views

Speed of MySQL type index access vs. binary jump search on a huge file?

I am dead set on moving over to a MySQL database for some huge data sets I'm working with but right now I don't have the time. In the meantime I am curious about a technical performance issue ...
3
votes
1answer
507 views

Allow client side direct access to the database [duplicate]

I am asking advice from the SQL graybeards. Because my following proposition goes against everything I have practiced. In this instance Let's assume we are developing a phone app. A social network ...
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 ...
3
votes
1answer
391 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
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 | +----+---------+...
3
votes
1answer
73 views

PHP mysql checking for relational equivalence

Suppose I have a users table and in that users table I have a role_id. In my roles table I have: users - id - role_id roles - id - name roles id | name 1 | admin 2 | normal Now ...
3
votes
1answer
910 views

How to deal with server-side and client-side naming conventions that clash? [closed]

I have a project that uses the underscore naming convention for the MySQL database and PHP scripts but uses camelCase for the javascript application (a common scenario I'm sure). However, once JSON ...
3
votes
1answer
155 views

What design route should I take?

So I've taken on a project at work that I'm having a hard time attacking, and I'd love some feedback and suggestions. I work for an online retail store where we have an old, +7k-line script that we ...
3
votes
1answer
299 views

Best way to rename existing unique field names in database?

I have a database table that contains id, filename, userId id is unique identifier filename should also be unique table may contain >10000 records When a user uploads a file it should be entered ...
3
votes
1answer
525 views

Checking for duplicate with encrypted values

I was hoping to get some advice on a particular task I'm trying to implement. I have a table that stores secure data and returns an ID as a representation of that data. No problems there. So, for ...
3
votes
2answers
209 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 ...
3
votes
1answer
118 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 ...
3
votes
1answer
13k views

Best Multiple tables product with categories

I was looking to create an EAV structure for an inventory management system. But I read this answer and decided against it. I am looking to create multiple tables for all my products. But the trouble ...
3
votes
2answers
236 views

Handling changes to data types and entries in a database migration

I'm fully redesigning a site that indexes a number of articles with basic search functionality. The previous site was written about a decade ago, and I'm salvaging about 30,000 entries with data ...
3
votes
0answers
81 views

How to let users specify their own logical conditions (PHP / Laravel)

I am currently trying to create a web application, that saves inbound emails. I have figured out how to save the incoming emails into my database, and I have all the email information available (...
3
votes
0answers
196 views

Dynamic API Data Validation

I am in the process of building an heavily data-driven web application written in Node.js / Typescript with Mariadb for the database engine. I am trying to put an emphasis on extensibility and DRY ...
3
votes
0answers
1k views

How to store unique sessions for logged in user(s) with different devices?

I want to do something like Facebook does. We can see any time where we're logged in. e.g.: Windows PC · New Delhi, India Edge · Active now Windows PC · New Delhi, India Chrome · 8 minutes ago ...
2
votes
6answers
6k views

Is it possible to keep only one Database for both web and desktop applications?

I'm experiencing a trouble with my business model, let me explain better. I'm developing a software for 1 year and few months, it's for the food industry, more exactly a software to: Delivery, Take ...
2
votes
1answer
4k views

How does Facebook calculate mutual friends?

How does Facebook calculate mutual friends? Does it cache all mutual friends for each user? Does it use MySQL to calculate mutual friends with a query?
2
votes
6answers
4k views

Dynamic Fields/Columns

What is the best way to allow for dynamic fields/database columns? For example, let's say we have a payroll system that allows a user to create unique salary structures for each employee. How could/...
2
votes
2answers
3k views

matching usernames with their password

We are working on a simple login/registration form. Our login script checks to see if the username and password exist in the same row of the database. If it does exist, we bring the user to a welcome ...
2
votes
4answers
1k views

Using a relational and a non-relational database in the same project?

I ran into a problem on the project I'm working on right now. It is basically an app that stores a path based on GPS coordinates. The app runs on android an saves the GPS location every second and ...
2
votes
2answers
164 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
4answers
1k views

Database agnostic DAO (NoSQL + SQL)

Background While writing a new component, I m in middle of making a decision of SQL/NOSQL database (Mongo vs Mysql) for my storage layer. As of today, mysql seems to be a perfect fit for my use-case (...
2
votes
5answers
7k views

Is it Considered Good SQL practice to use GUID to link multiple tables to same Id field?

I want to link several tables to a many-to-many(m2m) table. One table would be called location and this table would always be on one side of the m2m table. But I will have a list of several tables ...
2
votes
3answers
202 views

Escaping strings in database layer

Can escaping functions (e.g. mysql_real_esacpe_string ) be moved down to the database layer where we would loop through all parameters passed for all queries and escape all strings. Would that be a ...
2
votes
2answers
667 views

Designing database: split into different tables or group them together?

I am fairly new to database design and now trying to build my own forum-based application. The app will have nested categories as countries > systems > levels > subjects In every subject ...
2
votes
3answers
122 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 ...
2
votes
5answers
482 views

Create Database To Fit Data vs Make Data Fit The Database

I'm newish to programming and would like to know what people have found to be the most supportable option or rather what people find more understandable. I'm the only one writing code at my firm, but ...
2
votes
2answers
2k views

How do MySQL joins really work?

In my case joining table inside subquery or outside subquery gives very few difference with COUNT CASE 1: about 6202 rows. In this case table_c is joined inside subquery, but is only joined (No ...
2
votes
3answers
4k views

High traffic chat - how to check if there is new message and show it for all users

I already had question about this but obviously it was not accepted very well, apparently too long when it's actually more information so you could have given me better answer. Ok, I will be much ...
2
votes
3answers
246 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: ...
2
votes
2answers
95 views

Server-side script to handle many near-simultaneous incoming XMLHttpRequests

I am building my own analytics platform, which I want to work like this... A JS script in each of my webpages collects data about users' clicking behaviours and sends that data to a PHP (or other ...
2
votes
2answers
112 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 ...
2
votes
4answers
9k views

What are some good tips for a developer trying to design a scalable MySQL database?

As the question states, I am a developer, not a DBA. I have experience with designing good ER schemas and am fairly knowledgeable about normalization and good schema design. I have also worked with ...
2
votes
4answers
2k views

Advice on making sure e-commerce site is secure using PHP and MySQL

Like the title says, I would like some advice from knowledgable web developers on figuring out security issues for my e-commerce site. I am designing the database as well as the code that ...
2
votes
1answer
310 views

Hidden Input Fields for POST - Security

I have seen some posts on the subject of hidden input fields for use with postbut none were able to answer my question. I have a delete button tied to a user in a table. The delete button uses a ...
2
votes
2answers
481 views

creating nodejs apps in php/mysql framework with later on full step by step migration to nodejs in mind

I'm looking for the most efficient path to convert over time my own made php framework for nodejs and I believe that nodejs experts and specific developers who had their years working with apache/php/...
2
votes
3answers
2k views

DB Schema design : single table with more columns vs multiple tables with fewer colomns

What would be better DB design for a social network website. A single table with more columns and less rows or multiple table with fewer columns but more rows. For example: User can post an update on ...

1 2 3
4
5
11