
Em Andamento
Publicado
Pago na entrega
Tenho um pequeno sisteminha de gestão com aproximadamente 10 modulos (Telas), Banco da dados em MySql, gostaria de trasnformar o bd e o script em multi tenancy, aonde em uma unica instalação eu possa acessar varias empresas diferente atraves do login.
ID do Projeto: 38750997
2 propostas
Projeto remoto
Ativo há 1 ano
Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos

I love developing and have read all the details of this job! My name is William Montilla, and I am eager to assist you in transforming your management system into a multi-tenancy application. With over a decade of experience in PHP and MySQL, I understand the intricacies of database design and user access management. I will restructure your database to support multiple companies while ensuring secure login and data segregation. My approach will prioritize efficiency and user experience, allowing seamless access for each company through a single installation. I can start immediately and look forward to collaborating with you to enhance your system!
$20 USD em 1 dia
1,4
1,4
2 freelancers estão ofertando em média $25 USD for esse trabalho

Hola Sir ## Multi-Tenancy Conversion for your PHP Script & MySQL Database Here's a breakdown of how to implement multi-tenancy for your existing PHP script and MySQL database, along with the considerations for a smooth transition: **1. Database Structure:** * **Tenant Table:** Create a new table (e.g., `tenants`) to store details about each tenant: * `id` (primary key) * `name` * `database_name` (optional, if using separate databases per tenant) * `other_tenant_specific_data` (e.g., contact info, billing details) * **Data Separation:** * **Separate Databases:** Create a new database for each tenant, using the `database_name` field from the `tenants` table. This offers optimal isolation but requires more database management. * **Table Prefixes:** Add a tenant-specific prefix to tables (e.g., `tenant_id_prefix_table_name`). This reduces database creation but requires more code changes. * **Tenant ID Column:** Add a `tenant_id` column to each existing table, linking data to the respective tenant. This is a good compromise for moderate data separation. **2. PHP Script Modifications:** * **Authentication and Tenant Selection:** * Modify login to identify the tenant based on username or other criteria. * Add a `tenant_id` or `tenant_name` session variable upon successful login. * Use this information to filter data, connect to the correct database, and prefix table names as needed. * **Data Access:** * Update all database queries to include the `tenant_id` or prefix, depending on your chosen strategy. * Use prepared statements and parameterized queries for better security and efficiency. **3. Code Examples:** **Example 1: Database Connection (Separate Databases)** ```php session_start(); $tenantId = $_SESSION['tenant_id']; $dbConfig = getTenantDatabaseConfig($tenantId); // Function to get database settings $conn = new mysqli($dbConfig['host'], $dbConfig['user'], $dbConfig['password'], $dbConfig['database']); // Use $conn for database operations ``` **Example 2: Data Access with Table Prefixes** ```php $tenantId = $_SESSION['tenant_id']; $prefix = "{$tenantId}_"; // Query with table prefix $sql = "SELECT * FROM {$prefix}users"; // ... ``` **4. Considerations:** * **Data Migration:** Carefully migrate existing data to the new multi-tenant structure. * **Performance:** Monitor performance and optimize database queries, especially if using separate databases per tenant. * **Security:** Implement robust security measures to prevent unauthorized access between tenants. * **Scalability:** Ensure the design can handle growing numbers of tenants. **5. Tools & Libraries:** * **Doctrine ORM:** Can help manage multi-tenancy with entities and repositories. * **Laravel:** Provides built-in support for multi-tenancy. * **Symfony:** Offers flexibility for multi-tenancy implementation. **Remember:** This is a high-level guide. The specific implementation will depend on your existing code, desired level of isolation, and resource constraints. Best regards, Giáp Văn Hưng
$30 USD em 7 dias
6,4
6,4

Colíder, Brazil
Método de pagamento verificado
Membro desde mar. 19, 2021
$10-30 USD
$30-250 USD
$2-8 USD / hora
$10-30 USD
$10-30 USD
₹750-1250 INR / hora
₹1500-12500 INR
€750-1500 EUR
₹12500-37500 INR
₹600-1500 INR
$30-250 USD
₹150000-250000 INR
€8-30 EUR
$2-8 USD / hora
$2-8 USD / hora
₹12500-37500 INR
₹12500-37500 INR
$250-750 USD
€750-1500 EUR
₹12500-37500 INR
₹600-1500 INR
₹1500-12500 INR
$250-750 USD
$2-8 USD / hora
€250-750 EUR