Enterprise Data Blueprint

Customer Database Schema

A scalable customer data model for e-commerce, SaaS, healthcare, banking, CRM, subscriptions, and enterprise applications.

15 core tables 9 operating domains AI-ready personalization Compliance-first audit layer

Example Customer Database

Open a ready-to-use PostgreSQL-style SQL file with table definitions and sample customer records.

What It Supports

Built for the full customer lifecycle

Identity management Contact information Authentication & security Sales & transactions Marketing communications Customer service Billing & payments Analytics & reporting Regulatory compliance Personalization & CRM

High-Level Relationship

Customers sit at the center

Customers
Customer_Addresses Customer_Authentication Customer_Preferences Orders -> Order_Items Payments Support_Tickets Customer_Communications Customer_Activity_Log Subscriptions Loyalty_Accounts AI_Customer_Profile Customer_Segment_Memberships

Table Dictionary

Core records, fields, and purpose

Customers

Primary customer identity, status, consent, and account activity.

FieldTypeDescription
customer_idUUID / BIGINTPrimary unique identifier
customer_numberVARCHARHuman-readable customer number
first_name, middle_name, last_name, full_nameVARCHARCustomer names
date_of_birth, gender, profile_photo_urlDATE / VARCHAR / TEXTProfile attributes
email, phone_mobile, phone_home, phone_workVARCHARContact channels
preferred_language, preferred_currencyVARCHARLocalization preferences
customer_status, customer_typeVARCHARLifecycle and segment classification
account_created_at, last_login_at, last_activity_atTIMESTAMPAccount activity timestamps
marketing_opt_in, sms_opt_in, email_verified, phone_verifiedBOOLEANConsent and verification flags
created_by, updated_atUUID / TIMESTAMPAdministrative ownership and updates

Customer_Addresses

Multiple billing, shipping, home, and geospatial addresses per customer.

FieldTypeDescription
address_id, customer_idUUIDPrimary key and customer reference
address_typeVARCHARBilling, shipping, home
address_line_1, address_line_2VARCHARStreet and unit details
city, state_province, postal_code, countryVARCHARLocation details
latitude, longitudeDECIMALGPS coordinates
is_primary, created_atBOOLEAN / TIMESTAMPPrimary flag and creation time

Customer_Authentication

Credentials, MFA, device/session data, lockouts, and reset history.

FieldTypeDescription
auth_id, customer_idUUIDPrimary key and customer reference
username, password_hash, password_saltVARCHAR / TEXTLogin credentials
password_last_changed, last_password_resetTIMESTAMPPassword lifecycle
mfa_enabled, mfa_secretBOOLEAN / TEXTMulti-factor configuration
failed_login_attempts, account_lockedINTEGER / BOOLEANLockout controls
last_login_ip, device_fingerprintVARCHAR / TEXTSecurity context
session_token, refresh_tokenTEXTActive session credentials

Customer_Preferences

Personalization, notification, communication, and accessibility settings.

FieldTypeDescription
preference_id, customer_idUUIDPrimary key and customer reference
theme_preferenceVARCHARDark or light mode
notification_preferencesJSONNotification settings
communication_channelVARCHARPreferred contact channel
interests, personalization_data, accessibility_settingsJSONInterests, AI data, and accessibility options

Orders & Order_Items

Purchases, status, pricing, tax, shipping, discounts, and line items.

FieldTypeDescription
order_id, customer_id, order_numberUUID / VARCHAROrder identity and customer reference
order_status, payment_status, payment_methodVARCHAROrder and payment state
order_total, tax_amount, shipping_amount, discount_amountDECIMALFinancial totals
billing_address_id, shipping_address_idUUIDAddress references
order_created_at, fulfilled_atTIMESTAMPOrder lifecycle timestamps
order_item_id, product_id, sku, product_nameUUID / VARCHARLine item identity
quantity, unit_price, total_price, tax_amountINTEGER / DECIMALLine item quantity and pricing

Payments

Financial transactions, providers, gateway IDs, ACH, invoices, and status.

FieldTypeDescription
payment_id, customer_id, order_idUUIDPayment, customer, and order references
transaction_id, payment_providerVARCHARGateway transaction tracking
payment_method, payment_statusVARCHARMethod and lifecycle state
amount, currencyDECIMAL / VARCHARPayment value
authorization_code, ach_trace_number, invoice_numberVARCHARBanking and invoice references
payment_dateTIMESTAMPPayment timestamp

Support_Tickets

Customer service cases, assignment, priority, resolution, and timing.

FieldTypeDescription
ticket_id, customer_idUUIDTicket and customer references
subject, descriptionVARCHAR / TEXTIssue summary and detail
ticket_status, priorityVARCHARStatus and urgency
assigned_agentUUIDSupport representative
resolution_notesTEXTResolution details
created_at, resolved_atTIMESTAMPSupport lifecycle timestamps

Customer_Communications

Email, SMS, phone, message body, direction, status, and timestamp history.

FieldTypeDescription
communication_id, customer_idUUIDCommunication and customer references
communication_type, directionVARCHAREmail, SMS, phone; inbound or outbound
subject, message_bodyVARCHAR / TEXTContent and message body
communication_status, sent_atVARCHAR / TIMESTAMPDelivery status and timestamp

Customer_Segments

Marketing and CRM segmentation rules plus customer memberships.

FieldTypeDescription
segment_id, segment_nameUUID / VARCHARSegment identity and name
description, rules_jsonTEXT / JSONSegment purpose and logic
membership_id, customer_id, segment_idUUIDMembership record and references
joined_atTIMESTAMPSegment join timestamp

Customer_Activity_Log

Behavioral analytics, sessions, devices, browsers, operating systems, and IPs.

FieldTypeDescription
activity_id, customer_idUUIDActivity and customer references
activity_type, page_urlVARCHAR / TEXTAction and page visited
device_type, browser, operating_systemVARCHARDevice and software context
ip_address, session_idVARCHARNetwork and session references
activity_timestampTIMESTAMPEvent timestamp

Subscriptions & Loyalty_Accounts

Recurring memberships, billing cycles, cancellations, points, tiers, and rewards.

FieldTypeDescription
subscription_id, customer_id, plan_nameUUID / VARCHARSubscription identity and plan
billing_cycle, subscription_statusVARCHARMonthly/yearly and active/cancelled state
start_date, renewal_date, cancellation_dateDATESubscription lifecycle dates
loyalty_id, points_balance, tier_levelUUID / INTEGER / VARCHARLoyalty identity, points, and tier
lifetime_points, last_activityINTEGER / TIMESTAMPTotal rewards and latest activity

Audit_Log & AI_Customer_Profile

Compliance audit trails plus AI-driven churn, LTV, sentiment, and recommendations.

FieldTypeDescription
audit_id, entity_name, entity_idUUID / VARCHARChanged entity reference
action_type, old_values, new_valuesVARCHAR / JSONInsert, update, delete and before/after values
changed_by, changed_atUUID / TIMESTAMPActor and change timestamp
ai_profile_id, customer_idUUIDAI profile and customer reference
churn_risk_score, lifetime_value_score, sentiment_score, engagement_scoreDECIMALPredictive model scores
recommendation_profile, behavioral_clusterJSON / VARCHARRecommendation data and AI cluster

Architecture Choices

Recommended database types

Relational Databases

Best for transactions, CRM systems, financial records, and strict relational integrity.

PostgreSQLMySQLMicrosoft SQL Server

NoSQL Databases

Best for large-scale analytics, flexible schemas, and AI personalization workloads.

MongoDBCassandraDynamoDB

Enterprise Readiness

Features to consider

  • Role-based access control
  • Encryption at rest and in transit
  • GDPR and CCPA compliance
  • API integrations and real-time synchronization
  • Data warehousing, event streaming, and search indexing
  • Backup, disaster recovery, sharding, and multi-tenancy
  • Machine learning, vector search, and AI analytics

Advanced Modules

Extend the model when your domain needs it

Healthcare records Insurance information Banking and KYC verification Fraud detection Referral systems Affiliate tracking Geospatial analytics IoT device tracking Social media integration Customer hierarchy Blockchain transaction logging AI conversational history Knowledge base interaction logs