A comprehensive data storage and querying solution that provides real-time synchronization, advanced filtering, and seamless scalability for your applications.
The Webburns Tech Database API provides a comprehensive data storage and querying solution with real-time synchronization, advanced filtering, and seamless scalability for your applications.
Base URL: https://api.webburnstech.com/db/v1/
GraphQL Endpoint: https://api.webburnstech.com/db/graphql
Current Version: v1.4.2
Format: REST and GraphQL APIs available
Use when:
Use when:
To start using the Database API, you'll need an API key with appropriate permissions. You can obtain one from the API Keys page.
All API requests must include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
Our Database API supports multiple database architectures to fit different use cases and requirements.
Traditional relational databases with ACID compliance, structured data, and complex joins.
Document and key-value stores for flexible schemas, horizontal scaling, and high throughput.
Optimized for relationship-heavy data with nodes, edges, and properties for complex traversals.
All database instances include automated backup and recovery with configurable retention policies:
Our database architecture ensures high availability through automated replication:
Database transactions follow ACID properties with configurable isolation levels:
The Database API layer handles critical responsibilities to ensure performance, security, and reliability.
Efficient database connection management to handle high concurrent requests:
Protection against common security vulnerabilities:
Optimized query execution through prepared statements:
Choose between Object-Relational Mapping and raw SQL queries based on your needs:
Benefits:
Use when:
Example schema for a typical e-commerce application:
-- Users table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) UNIQUE NOT NULL,
first_name VARCHAR(100),
last_name VARCHAR(100),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Products table
CREATE TABLE products (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(255) NOT NULL,
description TEXT,
price DECIMAL(10,2) NOT NULL,
stock_quantity INTEGER DEFAULT 0,
category_id UUID REFERENCES categories(id),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Orders table
CREATE TABLE orders (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id),
status VARCHAR(50) DEFAULT 'pending',
total_amount DECIMAL(10,2),
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Indexes for performance
CREATE INDEX idx_products_category ON products(category_id);
CREATE INDEX idx_orders_user ON orders(user_id);
CREATE INDEX idx_orders_created ON orders(created_at);
Comprehensive security measures to protect your data and ensure proper access control.
Multiple authentication methods supported for different use cases:
Obtain an access token using various authentication methods.
| Parameter | Type | Required | Description |
|---|---|---|---|
| grant_type | string | Yes | Authentication method (api_key, jwt, authorization_code, client_credentials) |
| api_key | string | No | API key for simple authentication |
| client_id | string | No | OAuth 2.0 client ID |
| client_secret | string | No | OAuth 2.0 client secret |
| refresh_token | string | No | Refresh token for obtaining new access token |
# API Key Authentication
curl -X POST "https://api.webburnstech.com/db/v1/auth/token" \
-H "Content-Type: application/json" \
-d '{
"grant_type": "api_key",
"api_key": "YOUR_API_KEY"
}'
import requests
# API Key Authentication
url = "https://api.webburnstech.com/db/v1/auth/token"
data = {
"grant_type": "api_key",
"api_key": "YOUR_API_KEY"
}
response = requests.post(url, json=data)
print(response.json())
const fetch = require('node-fetch');
// API Key Authentication
const url = 'https://api.webburnstech.com/db/v1/auth/token';
const data = {
grant_type: 'api_key',
api_key: 'YOUR_API_KEY'
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
// API Key Authentication
const url = 'https://api.webburnstech.com/db/v1/auth/token';
const data = {
grant_type: 'api_key',
api_key: 'YOUR_API_KEY'
};
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "def50200aecc12...",
"scope": "data:read data:write",
"account": {
"id": "acc_123456",
"name": "John Doe",
"plan": "professional"
}
}
Fine-grained access control with role-based permissions:
Secure token lifecycle management:
Comprehensive REST API for all database operations with predictable, resource-oriented design.
Retrieve records from a table with optional filtering, sorting, and pagination.
| Parameter | Type | Required | Description |
|---|---|---|---|
| table | string | Yes | Name of the table to query |
| filter | string | No | JSON filter expression |
| sort | string | No | Sort by field and direction (e.g., "name:asc") |
| limit | integer | No | Maximum number of records to return (default: 100) |
| offset | integer | No | Number of records to skip for pagination |
# Get users with filters
curl -X GET "https://api.webburnstech.com/db/v1/data/users?filter={\"status\":\"active\"}&sort=created_at:desc&limit=10" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
url = "https://api.webburnstech.com/db/v1/data/users"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
params = {
"filter": '{"status":"active"}',
"sort": "created_at:desc",
"limit": 10
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)
const fetch = require('node-fetch');
const url = new URL('https://api.webburnstech.com/db/v1/data/users');
url.searchParams.append('filter', JSON.stringify({status: 'active'}));
url.searchParams.append('sort', 'created_at:desc');
url.searchParams.append('limit', '10');
fetch(url, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"data": [
{
"id": "user_123",
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"status": "active",
"created_at": "2023-06-15T10:30:00Z"
},
{
"id": "user_456",
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Smith",
"status": "active",
"created_at": "2023-06-14T14:22:00Z"
}
],
"pagination": {
"total": 150,
"limit": 10,
"offset": 0,
"has_more": true
}
}
Create a new record in the specified table.
| Parameter | Type | Required | Description |
|---|---|---|---|
| table | string | Yes | Name of the table to insert into |
| data | object | Yes | Object containing field-value pairs for the new record |
# Create a new user
curl -X POST "https://api.webburnstech.com/db/v1/data/users" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "newuser@example.com",
"first_name": "Alice",
"last_name": "Johnson",
"status": "active"
}'
import requests
url = "https://api.webburnstech.com/db/v1/data/users"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
data = {
"email": "newuser@example.com",
"first_name": "Alice",
"last_name": "Johnson",
"status": "active"
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
const fetch = require('node-fetch');
const url = 'https://api.webburnstech.com/db/v1/data/users';
const data = {
email: 'newuser@example.com',
first_name: 'Alice',
last_name: 'Johnson',
status: 'active'
};
fetch(url, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"id": "user_789",
"email": "newuser@example.com",
"first_name": "Alice",
"last_name": "Johnson",
"status": "active",
"created_at": "2023-06-20T09:15:00Z",
"updated_at": "2023-06-20T09:15:00Z"
}
Beyond basic CRUD, the Database API supports advanced operations:
A flexible GraphQL API for efficient data fetching with a strongly-typed schema.
The GraphQL API provides a complete schema for all your database operations:
# GraphQL Schema Overview
type Query {
# Get a single record by ID
user(id: ID!): User
product(id: ID!): Product
order(id: ID!): Order
# Get multiple records with filtering
users(
filter: UserFilter
sort: String
limit: Int
offset: Int
): UserConnection!
products(
filter: ProductFilter
sort: String
limit: Int
offset: Int
): ProductConnection!
orders(
filter: OrderFilter
sort: String
limit: Int
offset: Int
): OrderConnection!
}
type Mutation {
# Create operations
createUser(input: CreateUserInput!): User!
createProduct(input: CreateProductInput!): Product!
createOrder(input: CreateOrderInput!): Order!
# Update operations
updateUser(id: ID!, input: UpdateUserInput!): User!
updateProduct(id: ID!, input: UpdateProductInput!): Product!
updateOrder(id: ID!, input: UpdateOrderInput!): Order!
# Delete operations
deleteUser(id: ID!): Boolean!
deleteProduct(id: ID!): Boolean!
deleteOrder(id: ID!): Boolean!
}
type Subscription {
# Real-time subscriptions
userCreated: User!
userUpdated: User!
orderStatusChanged: Order!
}
# Example type definitions
type User {
id: ID!
email: String!
firstName: String
lastName: String
status: UserStatus!
orders: [Order!]!
createdAt: DateTime!
updatedAt: DateTime!
}
type Product {
id: ID!
name: String!
description: String
price: Float!
stockQuantity: Int!
category: Category
createdAt: DateTime!
}
type Order {
id: ID!
user: User!
products: [OrderProduct!]!
status: OrderStatus!
totalAmount: Float!
createdAt: DateTime!
}
Example GraphQL queries for common operations:
# Query with nested relationships
query GetUserWithOrders($userId: ID!) {
user(id: $userId) {
id
email
firstName
lastName
orders(limit: 5, sort: "created_at:desc") {
id
status
totalAmount
createdAt
products {
id
name
price
quantity
}
}
}
}
# Mutation to create a new user
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
email
firstName
lastName
createdAt
}
}
# Subscription for real-time updates
subscription OnOrderStatusChanged {
orderStatusChanged {
id
status
user {
id
email
}
updatedAt
}
}
| Feature | REST API | GraphQL API |
|---|---|---|
| Data Fetching | Multiple requests for related data | Single request for nested data |
| Over-fetching | Common - get all fields | None - request only needed fields |
| Under-fetching | Common - need multiple requests | None - get all data in one request |
| Caching | HTTP caching works well | More complex caching strategies |
| Learning Curve | Low - familiar to most developers | Medium - requires learning GraphQL |
| Real-time Updates | WebSockets or polling | Built-in subscriptions |
We provide several tools to help you work with the GraphQL API:
https://api.webburnstech.com/db/graphqlRate limiting ensures fair usage and protects the system from abuse.
| Plan | Requests per Minute | Requests per Hour | Concurrent Connections |
|---|---|---|---|
| Free | 60 | 1,000 | 5 |
| Starter | 300 | 10,000 | 20 |
| Professional | 1,000 | 100,000 | 100 |
| Enterprise | Custom | Custom | Custom |
All API responses include rate limit headers:
When you exceed rate limits, the API returns a 429 status code. Implement exponential backoff for retries:
// Exponential backoff implementation
async function makeRequestWithRetry(url, options, maxRetries = 5) {
let retries = 0;
while (retries <= maxRetries) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
// Rate limited - wait and retry
const retryAfter = response.headers.get('Retry-After') || Math.pow(2, retries);
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
retries++;
continue;
}
return response;
} catch (error) {
if (retries >= maxRetries) throw error;
await new Promise(resolve => setTimeout(resolve, Math.pow(2, retries) * 1000));
retries++;
}
}
}
Monitor your API usage through:
Consistent error responses with detailed information for debugging.
All errors follow the same response format:
{
"error": {
"code": "validation_error",
"message": "Invalid input data",
"details": {
"email": "Must be a valid email address"
},
"request_id": "req_123456789",
"documentation_url": "https://docs.webburnstech.com/errors/validation_error"
}
}
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | validation_error | Request validation failed |
| 401 | authentication_error | Invalid or missing authentication |
| 403 | authorization_error | Insufficient permissions |
| 404 | not_found | Resource not found |
| 409 | conflict | Resource conflict (e.g., duplicate) |
| 422 | unprocessable_entity | Business logic validation failed |
| 429 | rate_limit_exceeded | Rate limit exceeded |
| 500 | internal_error | Internal server error |
| 503 | service_unavailable | Service temporarily unavailable |
Implement retry logic for transient errors (5xx status codes):
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
# Configure retry strategy
retry_strategy = Retry(
total=3,
status_forcelist=[429, 500, 502, 503, 504],
method_whitelist=["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"],
backoff_factor=1
)
# Apply retry strategy to session
adapter = HTTPAdapter(max_retries=retry_strategy)
session = requests.Session()
session.mount("https://", adapter)
session.mount("http://", adapter)
# Make request with retry logic
response = session.get("https://api.webburnstech.com/db/v1/data/users")
Monitor errors in your application:
Optimize your database performance and scale effectively as your application grows.
Best practices for optimal query performance:
Efficient database connection handling:
Scale your database as your application grows:
Monitor database performance with built-in tools:
Comprehensive monitoring, logging, and tracing for your database operations.
Detailed logs for all database operations:
Real-time performance and usage metrics:
Distributed tracing for complex operations:
Proactive alerting for issues and anomalies:
Step-by-step guide for migrating from other database solutions.
Plan your migration carefully to minimize downtime and risk:
Use our migration tools to simplify the process:
Typical migration process:
Migration guides for specific scenarios:
Essential security practices for protecting your database and data.
Use strong API keys, implement proper access controls, and follow the principle of least privilege.
Use HTTPS for all API calls, implement IP whitelisting, and consider VPC peering for private networks.
Enable encryption at rest and in transit. Use field-level encryption for sensitive data.
Validate all input data, use parameterized queries, and implement proper error handling.
Enable comprehensive audit logging and regularly review access patterns and changes.
Keep your API client libraries updated and monitor for security advisories.
Implement regular backups, test recovery procedures, and have a disaster recovery plan.
Additional security recommendations:
We recommend using our migration tools with a blue-green deployment strategy. Test migrations thoroughly in a staging environment first, and have a rollback plan in case of issues. For zero-downtime migrations, use our incremental migration feature.
Our API provides a unified interface for both SQL and NoSQL databases. SQL databases are best for structured data with complex relationships and transactions. NoSQL databases are better for flexible schemas, horizontal scaling, and high-throughput scenarios. You can choose the right database type for each use case.
Start by creating indexes on frequently queried columns. Use the EXPLAIN feature to analyze query performance. Implement pagination to limit result sets. Consider denormalization for frequently accessed related data. Use our query performance dashboard to identify slow queries.
Yes, our API supports ACID transactions across multiple tables and even multiple databases in the same transaction. Use the transaction endpoints to group operations that should succeed or fail together.
Real-time synchronization uses change data capture (CDC) to stream database changes to connected clients. You can subscribe to changes at the table, row, or even field level. Changes are delivered via WebSocket connections with automatic reconnection.
We provide automated daily backups with 30-day retention. Point-in-time recovery is available for the last 7 days. You can also create manual snapshots and export data in various formats. Cross-region replication is available for disaster recovery.
Start with vertical scaling (increasing resources) for initial growth. For read-heavy workloads, add read replicas. For write-heavy workloads or very large datasets, consider sharding. Our auto-scaling feature can automatically adjust resources based on workload patterns.
All data is encrypted at rest and in transit. We support role-based access control, network isolation, IP whitelisting, and comprehensive audit logging. Regular security patches and vulnerability scanning are performed. SOC 2 Type II and GDPR compliance are available for enterprise plans.