I'm writing an application that that I'm going to provide as a service and also as a standalone application. It's written in Zend Framework and uses MySQL.
Bir hizmet olarak sunmak ne zaman kullanıcıların sitemde kayıt ve customer1.mysite.com, customer2.mysite.com gibi subdomaininiz istiyorum.
Ben her kullanıcı için yeni bir veritabanı yaratmak değil, tek bir veritabanında her şeyi istiyorum.
But now I wonder how to do it better. I came up with two solutions: 1. Have user id in each table and just add it to WHERE clause on each database request. 2. Recreate tables with unique prefix like 'customer1_tablename', 'customer2_tablename'.
Which approach is better? Pros and cons? Is there another way to separate users on the same database?
Leonti