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

learn more… | top users | synonyms

3
votes
4answers
803 views

My father wants to learn PHP-MySQL to port his application. What I should do to help?

My father is a doctor/physician. About 15 years ago he started writing an application to handle his patient's medical records in his clinic at home. The app has the ability to input patient's medical ...
2
votes
1answer
447 views

Is it safe to use LAST_INSERT_ID() in a system like Point of Sale

Is it safe to use LAST_INSERT_ID() in a system using MySQL like Point Of Sale when there are multiple users using the system at the same time?
1
vote
3answers
201 views

Help with DB Structure, vOD site

I have a video on demand style site that hosts series of videos under different modules. However with the way I have designed the database it is proving to be very slow. I have asked this question ...
6
votes
2answers
2k views

Making the switch from MySQL to PostgreSQL?

I've spent the last year becoming really comfortable with MySQL, but due to its increasing trendiness and my desire to homogenize my web-apps with Heroku, I'd like to start using PostgreSQL for my web ...
6
votes
3answers
218 views

What's the difference between the insert methods and why one is faster

I have insert 14.485 lines on MySQL like this: INSERT INTO `bairros` (`id`,`cidade_id`,`descricao`) VALUES (1,8891,'VILA PELICIARI'); INSERT INTO `bairros` (`id`,`cidade_id`,`descricao`) VALUES ...
1
vote
2answers
150 views

Using replacement to get possible outcomes to then search through HUGE amount of data

I have a database table holding 40 million records (table A). Each record has a string a user can search for. I also have a table with a list of character replacements (table B) i.e. i = Y, I = 1 ...
1
vote
2answers
465 views

1 to 1 Comparison and Ranking System

I'm looking to create a comparison and ranking system which allows users to view 2 items, click on the one that they feel is the better one and then get presented with 2 more random items and continue ...
0
votes
1answer
99 views

Identifying elements from data feeds generated by affiliate sites

I am working with data feeds from affiliate sites. The basic idea is to provide an interface where the user can paste a link to an XML datafeed (these are huge btw, around 60 mb) that would then be ...
2
votes
3answers
395 views

Application Logic Vs DB Triggers for database cleaning

When cleaning out old data from a set of database tables, is it safer to have the logic in the application or in a database trigger? I am upgrading an application that I wrote a while back (and in a ...
13
votes
6answers
8k views

Is there any reason to use varchar over text columns in a database?

Is varchar just a remnant from before text came around, or are there use cases where you would want to use a varchar? (Or char for that matter..) (I use Postgres and MySQL (MyISAM) daily, so those ...
2
votes
6answers
2k 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 ...
2
votes
2answers
178 views

Better way to search for text in two columns

Here is the scenario. I am making a custom blogging software for my site. I am implementing a search feature. It's not very sophisticated - basically it just takes the search phrase entered and runs ...
0
votes
2answers
175 views

How should I handle using two databases with a legacy PHP application?

I have a legacy PHP application that was written in 2004 and uses MSSQL as a database backend. At this stage MSSQL is still supported by PHP but only just via a Microsoft driver. I have looked at ...
5
votes
2answers
4k views

Is a blob more efficient than a varchar for data that can be ANY size?

When setting up a database I want to use the most efficient data type for potentially fairly long data. Currently my project is to store song titles and thoughts pertaining to that song. Some titles ...
3
votes
4answers
435 views

Entity and pattern validation vs DB constraint

When it comes to performance: What is the better way to validate the user input? If you think about a phone number and you only want numbers in the database, but it could begin with a 0, so you will ...
14
votes
3answers
7k views

How to design highly scalable web services in Java?

I am creating some Web Services that would have 2000 concurrent users. The services are offered for free and are hence expected to get a large user base. In the future it may be required to scale up ...
1
vote
3answers
2k views

What is the main difference between HAS_MANY and BELONGS TO relationship in mysql?

After making little progress in web development and php I figured out if I can make my grip strong on database designing, I will be able to reduce much code and time in developing the application. But ...
1
vote
3answers
805 views

Pattern for Accessing MySQL connection

We have an application which is C++ trying to access MySQL database. There are several (about 5 or so) threads in the application (with Boost library for threading) and in each thread has a few ...
12
votes
2answers
523 views

How to temporarily save the result of the query, to use in another?

I have this problem I think you may help me with. P.S. I'm not sure how to call this, so if anyone finds a more appropriate title, please do edit. Background I'm making this application for ...
1
vote
2answers
470 views

Almost Realtime Data and Web application

I have a computer that is recording 100 different data points into an OPC server. I've written a simple OPC client that can read all of this data. I have a front-end website on a different network ...
0
votes
2answers
565 views

How to store cache?

The data in my website is stored in many different tables(friends,relatives,etc) and every-time I have to query each and every table. But all this data is subject centric. E.g. data for a person is of ...
55
votes
12answers
44k views

Is it a bad practice to store large files (10 MB) in a database? [closed]

I am currently creating a web application that allows users to store and share files, 1 MB - 10 MB in size. It seems to me that storing the files in a database will significantly slow down ...
5
votes
2answers
418 views

When should I start the server side coding?

I am creating a website, where users can upload their own videos. So far I am just building the main structure with HTML and CSS. Is it a better practice to write server-side code before the site ...
0
votes
2answers
632 views

Wildcard user in select statement on indexed varcharcolumn

This question is based on some testing I've done recently in order to better understand SQL indexing system. Table with 500k entries, InnoDB engine This is a simple select query on a varchar field. ...
3
votes
1answer
395 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: ...
0
votes
1answer
181 views

mysql fulltext search table design

I have been working on a Mysql db design which keyword based search seems to be necessary. Main table has two columns: id | Title For each entry, users will be required to enter 4 or 5 keywords. I ...
3
votes
1answer
2k views

mysql, one connection vs multiple

On nodejs with node-mysql, should I create one connection for the service like this: var client = mysql.createClient({ user: 'user', password: 'pass' }); // Create a new mysql Client ...
4
votes
3answers
335 views

Rule of thumb for field sizes

What VARCHAR sizes should be used for first and last names, phone numbers (preferably international), email adresses, urls, dictionary words and file names? Edit: Zapped the introductory phrase to ...
4
votes
4answers
687 views

Should I perform encryption in the front end or within the database?

I want to store an encrypted string (specifically, email addresses) in a database. I'm currently using Python and MySQL. I was initially going to use MySQL's AES_ENCRYPT/DECRYPT to handle it, but then ...
1
vote
3answers
1k views

How do I approach this PHP/MYSQL query?

I have a reservation system that I have coded and my final task is to allow the user to enter a set of dates and then show them all available options. The reservation table is set up with unit_id, ...
7
votes
2answers
876 views

How to separate sensitive data in database(MySql)

I need to design a database that will contains information about personal disease of users. What can be the approach in order to implement the columns of the DB's tables: encrypt the information, ...
-2
votes
1answer
211 views

Adding a forum to an existing site

I've got a site with ~500 registered members, 300 of which are what you'd call "active". Site data is kept in a MySQL dbase. I'd like to add a myBB forum to the site, but this question applies to any ...
3
votes
5answers
3k views

Is database based chat room bad idea?

Most of simple "group chat" systems are based on local file storage logs (e.g. log.txt ). I'm developing a simple group chat (under 20 users simultaneity ) with jQuery/AJAX. So basically, ...
1
vote
1answer
415 views

choosing Database and Its Design for Rails

I am having a difficulty in deciding the database & its structure. Let us say the problem is like this. For my product I have various customers( each is an educational institute) Each customer ...
1
vote
2answers
3k views

Store HighRes photos in Database or as File?

I run a site which has a couple of million photos and gets over 1000 photos uploaded each day. Up to now, we haven't kept the original file that was uploaded to conserve on space. However, we are ...
1
vote
4answers
2k 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 ...
1
vote
1answer
235 views

Data base structure of a subscriber list

I am building a application that allow different user to store the subscriber information To store the subscriber information , the user first create a list For each list, there is a ListID. ...
1
vote
2answers
830 views

MySQL with mutiple threads and processes

I'm developing a telecom messaging platform in C, and I'm going to need multiple processes to be working with MySQL DB. How can I make two processes read/write to/from a Mysql DB and, if/when one of ...
3
votes
7answers
5k views

What is the best approach for database design with lots of columns?

I am writing a query based financial application. It lets the user to write complicated equations (much like WHERE part of an SQL query) and find companies matching those criteria. For the above, I ...
8
votes
6answers
7k views

Is MongoDB the right choice in my case? [closed]

I'm going to build my first real project in Rails that consist in a web app made of 3 main parts: The static part where no database is used The User registration part which will require a database ...
5
votes
2answers
3k views

Patterns for Versioning Relational Data in a MySQL database?

I am trying to find an approach for a project, where A user can edit records, and be able to see past versions of those records. Here is a simlified example schema, using a list: TABLE list ( id ...
2
votes
1answer
277 views

How to swap out a DB from MySQL to SQL Server in a multiple large projects?

Is there a sane way / best practices way to swap out a DB from MySQL to SQL Server in a multiple large projects? Some of the projects are ASP projects, some of them are windows services, some are ...
8
votes
5answers
529 views

Most common website scalability pitfalls

We are designing a website/web application where we hope to to achieve high user counts and, in general, lots of use. More specifically, we intend to be using PHP as the programming/scripting language ...
7
votes
5answers
2k views

Is MySQL viable for small-medium business applications

After having worked with a Microsoft stack - VB.Net, ASP.Net, SQL Server - for the past 10 years, we are now faced with having to develop an application for both Windows and Mac environments. It has ...
6
votes
1answer
410 views

Is there a way you'd implement a fast tree traversal method that would support dated versioning?

I've got a catalog at work and I want to juke it up a bit because I'm tired of it being extremely slow. I'd like to support the modified preorder tree traversal storage method for the category tree of ...
1
vote
2answers
115 views

In which format should I sent the values in database in PHP?

I am developing an application which is based on the quiz contest for competetive exams. The user can give different categories of tests, which will contain different types of questions of following ...
-1
votes
1answer
108 views

Which of the following data duplication options across shards is recommended?

High performance mysql book suggests that for sharding a blog application, one may want to put comments data across 2 shards: first, on the shard of a person posting comment, and on the shard where ...
1
vote
1answer
215 views

Is using dynamically generated code as cache a good idea?

I have a web search interface that can compare products in a table. This data set changes a few times a week. I have been storing a "DISTINCT" list (used for parametric selection) in a cache table. ...
4
votes
1answer
365 views

Technique for multiple users on same datasets

This is more a learning question than coding, but I'm certain it's a common issue for anyone developing administration systems or applications in php/mysql/js etc. I've developed quite a complex ...
0
votes
2answers
485 views

How to store personal information properly?

It's not about security or something. There is a table to record user information, like username, password, postcode and so on, one record per person. There is also a table called post to record the ...