Reputation: 11
I'm writing a program that runs (24/7) on a Linux server and adds entries to a MySQL database. The contents of the database are presented on a web interface with PHP and the user should be able to delete entries using the web interface. Is it possible to access the database from multiple processes at the same time?
Upvotes: 1
Views: 739
Reputation: 10284
Yes and there will not be any problems while trying to delete records in the presence of that automated program which runs 24/7 if you are using the InnoDb engine. This is because transactions happen one at a time, one starts after another has finished and the database is consistent everytime.
This answer How to implement the ACID model for a database has many relevant points.
Read about the ACID Properties of a database. A Mysql database with InnoDb engine will take care of all these things for you and you need not worry about that.
Upvotes: 0
Reputation: 2900
Yes multiple users can access the database at the same time. You should however take care that the data is consistent. If you create/edit entry with many small sql statements and in the meantime someone useses the web interface this may lead to some errors. If you have a simple db this should not be a problem, else you should consider using transactions.
http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-transactions.html
Upvotes: 0
Reputation: 218827
Yes, databases are designed for this purpose quite well. You'll want to keep a few things in mind in your designs:
Upvotes: 1
Reputation: 11478
Unless you're doing something like accessing the DB using a singleton, the max number of simultaneous mysql connections php will use is limited in your php.ini. I believe it defaults to 100.
Upvotes: 0