API Maker's Deep Populate for MySQL enables complex, nested, and cross-database queries with a single API call. It eliminates the need for manual SQL joins or multiple backend integrations, making relational data retrieval effortless.
This guide covers everything you need to implement MySQL Deep Populate in modern, multi-database environments.
MySQL's structured, transactional strengths combined with API Maker's Deep Populate create powerful APIs that access nested data seamlessly across multiple database systems.
Deep populate uses s_key
(source key) and t_key
(target key) to define relationships:
{
"s_key": "foreign_key_field",
"t_instance": "database_type",
"t_db": "database_name",
"t_col": "target_table",
"t_key": "primary_key_field",
"select": "field1,field2,field3",
"isMultiple": false
}
Request:
GET /api/schema/mysql/shop/products?find={"product_id":10}&deep=[{
"s_key": "category_id",
"t_instance": "mysql",
"t_db": "shop",
"t_col": "categories",
"t_key": "id",
"select": "name,description"
}]
Response:
{
"product_id": 10,
"name": "Gaming Laptop",
"category_id": {
"id": 3,
"name": "Electronics",
"description": "Electronic gadgets and devices"
}
}
Request:
GET /api/schema/mysql/sales/orders?find={"order_id":1001}&deep=[{
"s_key": "id",
"t_col": "order_items",
"t_key": "order_id",
"isMultiple": true,
"deep": [{
"s_key": "product_id",
"t_col": "products",
"t_key": "id",
"select": "name,price",
"deep": [{
"s_key": "supplier_id",
"t_col": "suppliers",
"t_key": "id",
"select": "company_name,contact_email"
}]
}]
}]
Response:
{
"order_id": 1001,
"id": 1001,
"order_items": [
{
"product_id": {
"id": 501,
"name": "USB Keyboard",
"price": 29.99,
"supplier_id": {
"id": 9,
"company_name": "TechGear Inc.",
"contact_email": "support@techgear.com"
}
}
},
{
"product_id": {
"id": 502,
"name": "Gaming Mouse",
"price": 59.99,
"supplier_id": {
"id": 11,
"company_name": "MouseWorks",
"contact_email": "sales@mouseworks.com"
}
}
}
]
}
Request:
GET /api/schema/mysql/sales/orders?find={"order_id":101}&deep=[{
"s_key": "customer_id",
"t_instance": "mongodb",
"t_db": "crm",
"t_col": "customers",
"t_key": "customer_id",
"select": "name,email,preferences"
}]
Response:
{
"order_id": 101,
"customer_id": {
"_id": "55",
"name": "Charlie Davis",
"email": "charlie@example.com",
"preferences": {"newsletter": true, "sms": false}
}
}
{
"s_key": "customer_id",
"t_col": "payments",
"t_key": "customer_id",
"find": {"status": "completed", "amount": {"$gte": 100}},
"isMultiple": true
}
{
"s_key": "category_id",
"t_col": "products",
"t_key": "category_id",
"sort": {"created_at": -1},
"limit": 10,
"skip": 0
}
API Maker supports MySQL as the primary database with seamless integration to multiple database types:
Best For: E-commerce, Content Management, Product Catalogs
Example Use Case: E-commerce platform where MySQL handles orders/payments while MongoDB stores product variants, images, and user-generated content.
Best For: Analytics, Reporting, Enterprise Applications
Example Use Case: SaaS application with MySQL for user data and PostgreSQL for advanced analytics and reporting.
Best For: Enterprise Integration, Legacy System Modernization
Example Use Case: Enterprise modernization where new applications use MySQL while maintaining Oracle for critical financial systems.
With API Maker, you can implement the multi-Database architecture in your projects and take advantage of all the supported databases.
s_key
and t_key
fieldsselect
to limit response payload size/api/schema/
endpoints instead of /api/gen/
for better performanceRetrieve nested data with filtering and sorting
GET /api/schema/mysql/db/table?deep=[...]
Create records with nested relationships in a single transaction
POST /api/schema/mysql/sales/orders
Content-Type: application/json
{
"customer_id": 123,
"order_date": "2024-08-05",
"order_items": [
{
"product_id": 456,
"quantity": 2,
"price": 99.99
}
]
}
Update parent records and automatically sync related data across databases
PUT /api/schema/mysql/sales/orders/1001
Content-Type: application/json
{
"status": "shipped",
"tracking_number": "TRK123456",
"deep_update": [
{
"s_key": "customer_id",
"t_instance": "mongodb",
"t_db": "crm",
"t_col": "customers",
"update_data": {
"last_order_date": "2024-08-05",
"order_count": {"$inc": 1}
}
}
]
}
Remove records with intelligent cascading across multiple databases
DELETE /api/schema/mysql/sales/orders/1001?cascade_deep=[
{
"s_key": "id",
"t_col": "order_items",
"t_key": "order_id",
"action": "delete"
},
{
"s_key": "customer_id",
"t_instance": "mongodb",
"t_db": "analytics",
"t_col": "customer_stats",
"action": "update",
"update_data": {
"total_orders": {"$inc": -1}
}
}
]
null
for unmatched relationshipsApproach | Setup Time | Cross-DB Support | Performance | Maintenance |
---|---|---|---|---|
API Maker Deep Populate | Minutes | Native | High | Minimal |
Custom Backend + ORMs | Weeks | Manual | Variable | High |
GraphQL Federation | Days | Complex | Good | Medium |
Multiple API Calls | Hours | Manual | Poor | Medium |
A: Technically unlimited, but recommended to stay under 5 levels for optimal performance.
A: The nested field returns null
, and you can check response metadata for details.
A: Yes, API Maker requires zero backend coding—everything is configured via JSON schemas.
A: Yes, API Maker can connect to existing MySQL databases without modifications.
A: API Maker delivers ~700+ requests/second on a single CPU core, with automatic caching and connection pooling.
Ready to implement MySQL Deep Populate? Start with the official API Maker documentation or explore the installation guide to set up your environment.
For technical support, visit the API Maker GitHub repository or contact their team directly.