● Travel Never Stops. Neither Do We. 365 Days a Year.
Connected thinking. Practical technology.

Database Design

Design databases around the transactions your business must protect, the history it must explain and the queries people need to run.

Professional using a business application on a laptop
Illustrative application workspace

Database design begins with decisions, not tables

A database is more than a place to save application information. It establishes which facts can exist, how they relate, who may change them and what happens when two processes disagree. A booking with several payment attempts, a customer shared across sales teams or an order revised after an invoice has been issued all expose design questions that a simple list of fields cannot answer.

TravelTech365 approaches database design by connecting those questions to a workable data model, constraints, transaction rules and operational procedures. The purpose is not to produce the largest possible schema. It is to make important states unambiguous, keep common operations practical and give future maintainers a reliable way to investigate inconsistencies.

Start with business vocabulary and record ownership

During discovery, identify what each business term means. Is a reservation request the same thing as a confirmed booking? Does a refund refer to money requested, approved or actually returned? Is an agent an individual login, an agency account or a commercial relationship? Agreeing those definitions avoids building incompatible assumptions into services and reports.

For each record, name its authoritative owner. A payment gateway may be authoritative for its transaction result, while the application owns the internal booking-to-payment allocation. A supplier controls whether an external reservation is confirmed; a local status must not claim otherwise. Record where external facts came from, when they were observed and whether they have been verified.

Identify the failures before the happy path

Ask what must happen when a payment callback arrives twice, a user abandons a form, an import contains an existing customer, or a background task crashes after saving half its work. Trace who needs the affected data next: customer service, reconciliation, finance, reporting or another integration. These questions produce design requirements that are testable. For example, repeated supplier notifications should not create repeated refunds, and removing a staff member should not erase the history of approvals they made. Such rules are easier to build deliberately than to reconstruct after production data has accumulated.

During discovery, also distinguish the operational record from data that is merely imported for reference. An availability response, for example, might expire or be superseded before the customer commits. Preserving its provenance is useful, but treating every observed offer as a confirmed inventory entitlement would be inaccurate. Decide which records may be discarded, which are retained for support, and which establish an obligation. This prevents transient integration data from quietly becoming the source for contractual or financial reporting.

Domain boundaries: what belongs together

A domain boundary is a practical ownership decision. Customer identity, booking fulfilment, payments and reporting may interact constantly, but they do not necessarily share one transaction or one definition of success. Separating them helps prevent a change in one workflow from silently rewriting another workflow's evidence.

Model the smallest consistent business operation

Decide which updates must succeed or fail together. Creating an internal payment attempt and reserving its unique reference might be one database transaction. Requesting confirmation from an external travel supplier cannot ordinarily be rolled back by a local database rollback. Instead, the application needs a durable pending state, a recorded external correlation reference and a recovery or reconciliation path. Keep transactions focused. A long-running transaction waiting for an API response can hold locks and complicate recovery. Record the intended action first, commit it, then process the external operation with explicitly defined outcomes. The precise sequence must respect the selected integration's documented behaviour.

Separate current state from related activity

A booking can have one current fulfilment state and many payment attempts, price revisions, support cases and status events. Combining them into a single mutable row either loses the history or creates arrays and columns whose meaning changes over time. Design linked records at the right level of detail: booking, traveller, itinerary component, payment attempt, refund request and provider reference. The correct boundary is not always a separate database or microservice. A well-structured relational database with clear ownership may be preferable to several independent stores that require frequent reconciliation. Make the separation logical first; distribute storage only when operating requirements justify it.

Make integration identities explicit

External identifiers are not necessarily unique across providers, accounts or environments. Store the source system, commercial account or other required scope alongside the external reference. Keep internal primary keys stable even when a supplier changes a reference or reissues a document. This matters for flight reservation systems, hotel bookings and payment reconciliation, where several external records can relate to one internal customer journey. An identifier is useful only when its uniqueness and lifetime are documented rather than assumed.

Engineering colleagues reviewing software together
Illustrative software review — make decisions, dependencies and acceptance evidence explicit.

Keys and constraints make invalid states harder to store

Primary keys identify rows. Foreign keys preserve relationships. Unique, not-null and check constraints express rules that should remain true regardless of which application component writes data. Their value is greatest when the model states those rules precisely, including exceptions.

Choose keys for stability, not convenience

An internal surrogate key can remain unchanged when an email address, booking reference or supplier identifier changes. Natural keys can still be valuable as separate unique business constraints. If a customer may have multiple verified emails, an email address is a poor permanent customer identifier; it belongs in a related contact record with a defined verification state.

For multi-tenant data, a uniqueness rule may need the tenant identifier: an agent's local code might be unique within one agency, not across every agency. Decide whether the tenant also belongs in foreign-key relationships to prevent linking a child record to another tenant's parent. Test imports, mergers and account transfers against these rules before choosing a key shape.

Put enforceable invariants in the database

An invoice line should reference a valid invoice; an amount should use an appropriate exact numeric representation; a completed item may require a completion timestamp. The PostgreSQL constraints documentation describes primary keys, foreign keys, uniqueness and check constraints, including important null behaviour. For PostgreSQL specifically, a foreign key does not automatically create an index on its referencing columns, so access and deletion patterns still need review.

Not every business rule fits a row constraint. A rule about the sum of several allocations, a conditional transition or a third-party status may require controlled transactional logic. Avoid hiding cross-row assumptions inside a check expression that cannot safely enforce them. Choose the mechanism based on what must remain correct under concurrent writes.

Define deletion and null semantics deliberately

A missing value is different from an empty string, zero or an unknown value. A nullable confirmation number can be appropriate while confirmation is pending; a nullable currency on a posted monetary transaction usually creates avoidable ambiguity. State what null means for each important field. Deletion rules deserve the same care. Cascading removal may be suitable for temporary child data, but not for payment attempts, approvals or financial adjustments that must remain explainable. In those cases, restrict deletion, use a lifecycle status or retain an appropriate historical record. Avoid treating soft deletion as a substitute for a retention and access policy.

Define deletion and null semantics deliberately
Record or relationshipDesign decisionFailure the rule should prevent
Agency and staff membershipSeparate user identity from agency membership; scope roles to the organisationA staff transfer changes the ownership of earlier bookings
Booking and travellersKeep a stable booking key and explicit traveller relationshipsEditing one passenger overwrites another passenger's details
External reservation referenceStore provider and account scope with the referenceTwo suppliers' matching reference strings are treated as one booking
Payment attempt and allocationPreserve each attempt and link accepted amounts to obligationsA repeated callback is counted as a second payment
Refund and adjustmentRecord requests, decisions and financial movements separatelyA requested refund is reported as money already returned

Normalisation first, denormalisation with a reason

Normalisation reduces conflicting copies of the same fact. When a supplier name, customer address or product description is repeated in many writable records, updates can leave different versions of what should be one current value. Separate entities and relationships where that distinction reflects the business model, not merely an academic diagram.

Preserve facts at their natural grain

A customer has contact methods; an itinerary has components; a room offer has rates and conditions tied to a particular search or confirmation. Each should be stored at the grain where it is meaningful. A single booking-wide cancellation rule is misleading if individual components carry different penalties, deadlines or approval conditions. A normalised transactional model also makes reporting definitions clearer. Analysts can decide whether they are counting bookings, components, travellers or payment attempts. Without explicit grain, joining several one-to-many relationships can multiply totals while returning rows that look entirely plausible.

Duplicate selectively for read performance or evidence

Some copying is justified. A confirmed order may need a snapshot of the displayed product description, quoted price and terms, even if the live catalogue later changes. That snapshot is historical evidence, not a competing editable master record. Similarly, a read model may store a precomputed booking total or search summary to avoid an expensive join on every page view. For each duplicate, document its origin, update trigger, acceptable delay and reconciliation process. If the cache or summary falls behind, the system should know how to rebuild it. Denormalisation without an owner merely moves complexity from reads into writes and incident response.

Plan for the queries people will actually run

Tables that accurately represent relationships can still perform poorly under real workloads. Begin with the application's important reads and writes: look up a booking by reference, show an agency's recent orders, reconcile unsettled payments, find overdue requests and export a period's approved adjustments. Record expected filters, sort orders, row counts and access scope.

Design indexes around predicates and ordering

An index can accelerate selective lookups, but each additional index consumes storage and adds work to changes. Composite indexes should reflect common combinations of tenant, status and timestamp rather than accumulating every available column. In PostgreSQL, multicolumn B-tree indexing is generally most effective when predicates constrain the leading columns, although planner optimisations can change a specific plan.

Avoid assuming that indexing every foreign key or every status field is automatically correct. Consider write frequency, selectivity and whether the query returns a small part of a table. Partial indexes and covering indexes may help in suitable cases; their value depends on actual filters and engine behaviour, not on an abstract index count.

Inspect plans with representative data

Use query plans to understand whether a database scans a table, uses an index, sorts a large result or repeatedly joins many rows. PostgreSQL's EXPLAIN documentation distinguishes estimated plans from EXPLAIN ANALYZE, which executes the statement and reports observed timing and row counts. Take particular care with data-changing statements: analysis can run the change unless it is safely contained and rolled back.

Test with realistic data distribution. A query that is fast with ten bookings may become expensive when one agency holds a large share of records. Compare estimates with actual rows, review parameter-sensitive cases and reassess after migrations. Prefer fixing an inefficient access pattern before adding infrastructure to mask it.

Design predictable listing and reporting paths

Use stable ordering for paginated lists, including a tie-breaker when many records share a timestamp. Large offset-based pagination can become expensive; cursor-based pagination is an option when the required navigation behaviour permits it. Bound interactive search filters and move extensive exports to controlled background processing. Operational queries and analytic reports need not compete on the same path. Read replicas, reporting stores or prepared summaries can help in some architectures, but they introduce freshness and reconciliation questions. Label the as-of time of reports when a delayed projection could affect a business decision. Related work includes data analytics and business intelligence.

Concurrency: correctness when operations overlap

Two users can update one record, a scheduled job can race a customer action, or multiple notifications can describe the same external event. A design must explain which operation wins, which must retry and when the second action should be rejected. These decisions are part of the business transaction, not just database tuning.

Understand isolation and locking

PostgreSQL uses multiversion concurrency control to provide transaction snapshots and also supports explicit locks; its concurrency documentation explains the underlying trade-offs. Isolation levels affect which anomalies can occur. They do not remove the need to reason about updates that depend on information read earlier. Use optimistic version checks where conflicts are uncommon and a user can reasonably refresh and retry. Use a suitable row lock or stronger isolation for a narrowly defined critical update when competing actions must serialize. Keep lock acquisition order consistent, transactions short and conflict handling visible to the application.

Treat retries as a new execution of the decision

A transient conflict is not permission to replay an old decision without checking its prerequisites. If a refund approval competes with another adjustment, the retry must reread the current balance and permissions. PostgreSQL's serialization failure guidance explicitly calls for retrying the complete transaction, including the logic that selects statements and values. Set finite retry limits, record the error type and surface a recoverable state when attempts continue to fail. Distinguish a retryable conflict from a permanent uniqueness violation. Automatic retries without those distinctions can turn a small concurrency issue into repeated load and confusing support records.

Keep external actions out of local atomicity assumptions

An API timeout does not establish whether the provider accepted a request. Store an idempotency or correlation key with the intended operation, reject duplicate local commands where appropriate, and reconcile uncertain outcomes before initiating a new charge or booking. A transactional outbox can record a message in the same database transaction as the business change, then publish it asynchronously; the consumer must still handle repeated delivery.

Do not describe an outbox as an exactly-once guarantee. The right result is a defined path for at-least-once processing, duplicates and failures between systems. Where an external provider offers a documented idempotency feature, apply its particular rules and retention behaviour rather than assuming all supplier APIs behave alike.

History: explain what was true and when

A current-status column answers a narrow question: what does this record say now? Support teams and auditors often need different answers: what was displayed to the customer, what did the supplier return, who approved a change and what information was available at that time? Design those questions into the data rather than hoping application logs will remain complete.

Decide between snapshots, revisions and events

Use immutable snapshots where the exact agreed content matters, such as a confirmed price breakdown or the terms accepted for an order. Use versioned records where a business object has successive approved forms. Use an event or audit trail when the sequence of actions matters, including actor, time, source and reason. These approaches can coexist, but they solve different problems.

An event trail is not automatically a replacement for a transactional model. Reconstructing state from events requires versioned event definitions, ordered handling and repair tools. Likewise, an audit table that stores only old and new status values cannot explain why a price changed. Capture enough context for the real investigation, while avoiding unnecessary personal information.

Define time, money and provenance precisely

Store timestamps with clear timezone semantics and preserve local date or scheduled time when it has distinct business meaning. A hotel check-in date is not simply a UTC instant; a payment settlement timestamp is. Specify which clock governs deadlines, reporting cutoffs and sequencing when notifications arrive late or out of order. Money deserves its own discipline. Use exact amounts with currency and explicit rounding rules; distinguish quoted, authorised, captured, refunded and payable figures. Never infer financial truth from the latest interface label. Preserve the provider response or reference needed for reconciliation, with sensitive fields excluded or protected according to agreed requirements.

Migrations and backfills without losing meaning

A schema change can be technically valid and still break an older application version, corrupt a report or change the meaning of historic data. Database evolution therefore needs a release sequence, not just a change script. Examine existing rows, connected services, data volume and the period when old and new application versions may coexist.

Expand, migrate, verify, then contract

For an incompatible change, add the new representation first while keeping existing readers functional. Update writers carefully, backfill historical values and compare both representations. Shift reads after validation; remove the old field or relationship only once dependencies have been retired. The approach is commonly called expand-and-contract, but the important point is maintaining a working contract throughout the transition. A new not-null or unique constraint may fail against legacy records. Detect violations in advance and define remediation rather than weakening rules silently. PostgreSQL's table modification documentation describes constraint changes and validation behaviour. For large live tables, review lock implications and consider supported online index-building options with their limitations.

Make backfills resumable and observable

A backfill should process an identifiable batch, record progress and tolerate interruption. Give it deterministic mapping rules, avoid overwriting records changed since its last read, and decide how to handle rows that cannot be mapped automatically. Separate the count of processed rows from the count of correctly reconciled business records. Rehearse using representative datasets and capture execution duration, lock waits and write pressure. A script that succeeds against a staging copy may still contend with live customer activity. Schedule and throttle it according to measured impact. Keep exceptions in an investigation queue rather than assigning a guessed value to satisfy a new column requirement.

Verify both data and application behaviour

Compare source and destination counts at the correct grain, then test relationships, totals, uniqueness, access and important historical cases. Row counts alone cannot detect wrong tenant mapping, duplicated payment allocations or a revised cancellation rule applied retroactively. Use targeted samples, reconciliation queries and end-to-end workflow tests. Define a rollback or forward-recovery decision before deployment. Reversing application code may not reverse newly written data. Maintain a record of executed migrations, the version of the writer and the checks required before a destructive step. This is especially relevant to legacy application modernization.

Access control and tenant separation belong in the model

Authorisation should not depend on a developer remembering an extra filter in every query. Model organisations, memberships, roles, delegation and record ownership explicitly. A person can belong to several organisations with different permissions; a record's tenant should not change merely because its creator changes employers.

Apply least privilege across every access path

Separate runtime, migration, reporting and support credentials. Grant only the rights each needs, restrict network access and protect secrets. The OWASP Database Security Cheat Sheet recommends least privilege and separate environments. For PostgreSQL, row-level security policies can restrict visible and modifiable rows, but privileged roles and table owners have important bypass behaviour that must be addressed in the design. Test direct queries, exports, background workers and administrative tools for cross-tenant leakage. If a support administrator can temporarily access another organisation's data, define approval, scope, expiration and audit evidence. Row security complements application authorisation; it does not decide whether a user is entitled to perform a business action.

Minimise sensitive data and control retention

Collect fields for a stated purpose, classify sensitive columns, and limit what appears in logs, backups, exports and non-production environments. Encryption and masking may be appropriate, but key ownership, access to decrypted data and rotation procedures require explicit decisions. A database can be encrypted while an overprivileged application still exposes its contents. Define retention, archival, correction and deletion behaviour according to approved products, relevant markets and applicable account permissions. Do not promise that a record can be erased instantly if it also supports an unresolved financial transaction. Agree the legitimate lifecycle and isolate information that no longer needs routine access.

Managed server infrastructure in an illustrative data centre
Illustrative infrastructure — reliable integrations need monitoring, recovery and clear operational ownership.

Backup, restore and recoverability are separate design tasks

Backups are not useful merely because a scheduled job says they succeeded. The real test is whether the correct database, supporting files, configuration and credentials can be restored to a usable service within an agreed business objective. Recovery must also account for actions completed in external systems while the local database was unavailable.

Set recovery objectives around business exposure

Define a recovery point objective as the maximum acceptable data loss interval and a recovery time objective as the target time to resume the required service. These are planning targets, not automatic guarantees. A financial operations system may need a different recovery approach from a marketing content store. Ask how pending payments and supplier confirmations will be reconciled after restore.

PostgreSQL documents SQL dumps, file-system backups and continuous archiving; its point-in-time recovery guidance explains the need for a base backup and relevant write-ahead logs. Managed services have separate procedures. For example, Amazon RDS point-in-time restore creates a restored database instance within the available retention window, subject to service and engine conditions.

Prove the restore works

Run recovery exercises into an isolated environment. Confirm schema compatibility, application connectivity, user privileges, encryption-key access, referential integrity and a sample of critical business transactions. Record actual elapsed time, any missing data and the work required to reconcile external operations. A restore that starts successfully but cannot support order processing has not met the business test.

Recovery exercises should include an intentionally awkward case, such as a payment notification received after the selected restore point. The team must know whether to reprocess the notification, retrieve the provider outcome or stop for manual review. Otherwise a technically accurate restored snapshot can create a fresh inconsistency when delayed workers resume. Test resuming queues and scheduled tasks only after the restored application's external side effects have been assessed. Assign owners for backup alerts, retention settings, restoration approval and post-incident reconciliation. Protect backups from accidental deletion and inappropriate access. Revisit the process after material schema, hosting or integration changes rather than assuming a successful test remains valid indefinitely.

Operational ownership after deployment

A database will change as features, data volume and integrations change. The handover should let an incoming engineer identify what is authoritative, what is derived and how to investigate a slow or inconsistent workflow. Useful documentation includes the entity model, critical constraints, sensitive fields, query assumptions, migration history and restore procedure.

Monitor integrity and workload together

Observe slow queries, lock waits, deadlocks, connection saturation, storage growth, replication delay where applicable, unsuccessful background jobs and backup status. Pair technical alerts with business checks: unmatched payment attempts, impossible status transitions, orphaned references and failed reconciliation batches. Not every performance problem is solved with an index; sometimes the workflow is producing redundant writes. Assign an owner and escalation path to each meaningful alert. Collect sufficient request and correlation identifiers to trace a case without putting cardholder or other unnecessary sensitive data into logs. Periodically review index usefulness and table growth, including whether an archival or partitioning approach is justified by measured access patterns.

Operational ownership also includes capacity decisions. Estimate growth separately for transactional rows, attachments, historical revisions and generated projections. Check whether housekeeping jobs can run without delaying checkout or agency operations, and define thresholds for revisiting the design. A growing history table may need a different retention or partitioning strategy from a small reference table. Changes should be justified by measured usage, with an owner responsible for the new maintenance work they introduce.

Review design changes as product changes

A new payment method, agency hierarchy or package type can alter cardinality and ownership. Require design review when a change introduces a new authoritative fact, cross-service dependency or financial state. Evaluate its effect on existing rows, historical reports, exports, permissions and restore procedures before deployment. A practical acceptance pack contains representative workflow tests, query-plan evidence for critical paths, migration validation results and a runbook. Delivery arrangements depend on the agreed scope; related architecture and hosting work can be considered through cloud and enterprise engineering.

Illustrative example: a booking with repeated payment notifications

Illustrative example only — not a description of a delivered customer project. Imagine a travel platform where a customer submits one booking request, the payment provider sends a success notification twice and the supplier confirmation remains pending. A simplistic design might update one booking row to “paid and confirmed” whenever any success response arrives. That confuses payment acceptance with fulfilment, creates a double-counting risk and leaves customer support without a trustworthy sequence of events.

A more defensible model separates the booking request, payment attempts, payment-event receipts, accepted payment allocation and supplier fulfilment attempt. Each has an internal key. External references are scoped to the relevant provider and account. A uniqueness rule prevents the same authenticated notification identifier, within its documented scope, from being applied twice. A transaction records the new receipt and its intended allocation atomically; a duplicate receipt is acknowledged or handled without another financial movement.

The application then requests supplier confirmation through a durable work item. A timeout leads to an “outcome unknown” state and a provider-specific enquiry or manual reconciliation route, not an automatic second booking. When confirmation is received, its reference and observed terms are retained. If fulfilment fails after payment, a separate approved refund or recovery workflow begins. Reports can now distinguish paid bookings, confirmed bookings, pending fulfilment and completed refunds.

The acceptance tests deliberately replay the callback, interrupt the worker after committing, change the booking while reconciliation is running and restore an earlier database snapshot. The system should preserve exactly one accepted allocation for the same supported payment event, but it cannot assume that a local rollback undoes the external charge. That distinction makes the design operationally honest.

Decisions to settle before implementation

The most useful design review produces choices that engineers can implement and business owners can verify. It also names the person authorised to resolve a disputed rule. The following checks help distinguish a ready requirement from an attractive diagram with unresolved behaviour.

Decisions to settle before implementation
Decision areaQuestion to settleEvidence to request before approval
OwnershipWhich system may change the authoritative value?Source-of-truth map and conflict example
IntegrityWhich invalid states must the database reject?Keys, constraints and concurrent-write tests
PerformanceWhich reads and writes must remain responsive?Query inventory, data volumes and sample plans
EvolutionCan old and new application versions coexist?Staged migration and resumable backfill plan
ProtectionWho can read, export, correct or retain each record?Role matrix and cross-tenant test cases
RecoveryHow will operations resume after a restore?Recovery exercise and reconciliation runbook

Database design connects naturally with web application development and SaaS development, but its decisions should remain visible rather than buried inside framework defaults. To discuss a new platform, database redesign or migration, share the major workflows, available schema, integration landscape and known pain points through Request a Quote. Scope, delivery approach and commercial terms are determined after requirements review.

Frequently asked questions

1. What is included in professional database design?

It starts with understanding the data that the application needs to create, change, retrieve and retain. The work can include a domain model, entity relationships, logical and physical schemas, keys, constraints, access rules, important query patterns, indexing recommendations and a migration approach. Operational considerations such as backup, restore, monitoring and ownership also belong in the design discussion. The precise deliverables depend on whether the assignment concerns a new product, an existing database or a particular performance problem. A schema diagram alone is insufficient if no one can explain what happens when a transaction fails, an external system disagrees or historic records must be interpreted after a business rule changes.

2. How do you decide between a relational database and a document database?

Begin with the relationships and consistency requirements, not a preferred technology label. A relational design is often appropriate when transactions span related entities, referential integrity matters and reports must join stable business facts. A document model may suit aggregates commonly read together with flexible structure, provided growth, indexing and update behaviour are understood. Some products need multiple storage models for different responsibilities, but that increases operational complexity. Evaluate actual query patterns, concurrency, data lifecycle, team experience, hosting constraints and recovery procedures. Do not move financial or booking facts into a document store merely because their upstream API response happens to be JSON.

3. Why should booking, payment and refund records be separate?

These activities represent different commitments. A booking records what the customer requested and what a supplier later confirmed. A payment attempt records a collection operation, which may fail, time out or be retried. A refund request records a proposed reversal, while a completed refund records an actual financial outcome. One booking can therefore relate to several attempts, partial payments, reversals and adjustments. Separate records preserve those relationships and make reconciliation possible without overwriting earlier events. The application can still show one clear customer status, but that display should be derived from trustworthy underlying facts rather than used as the sole financial record.

4. Should every table have a primary key and every relationship a foreign key?

Most enduring business tables benefit from a stable primary key, while explicit foreign keys protect important relationships within a relational database. However, the design must account for staging tables, external data that is not yet validated, temporary processing structures and links across separate systems. A database foreign key cannot enforce a relationship to a remote supplier. In those situations, use a local reference, controlled validation and reconciliation. Define which relationships can be optional and what deletion is permitted. Also review index needs separately: a foreign-key declaration does not necessarily create an efficient access path on the referencing side in every database engine.

5. What is the difference between normalisation and denormalisation?

Normalisation organises data so one current fact is not independently maintained in many places. It helps prevent conflicting updates and makes relationships explicit. Denormalisation deliberately stores a duplicate or derived value to support a particular read pattern or preserve an agreed historical snapshot. Neither choice should be automatic. A confirmed booking price is worth preserving even if the live offer changes, while copying a customer's current phone number into every editable booking can create confusion. When duplicating information, specify whether the copy is an immutable snapshot, a cache or a read projection; who refreshes it; and how inconsistencies are detected and repaired.

6. How do you prevent duplicate bookings or payment records?

First identify what counts as the same business operation. An identical request body may be a legitimate second purchase, while a repeated notification identifier may be one previously processed event. Use appropriately scoped unique constraints and application idempotency records, then process the relevant state change atomically. Record external provider references and reconciliation status. Test repeated callbacks, simultaneous requests, timeout-and-retry behaviour and messages delivered out of order. Local duplicate prevention does not prove that an external supplier completed only one transaction. That uncertainty requires supplier-supported enquiries or an agreed manual recovery process, depending on the integration and permissions available.

7. Can database constraints enforce every business rule?

No. They are excellent for stable row and relationship invariants such as non-null values, uniqueness, valid references and certain numeric ranges. Other rules depend on multiple rows, a sequence of approvals, a user's authorisation at a particular moment or information held by another system. Such rules need carefully designed transaction logic, potentially with locks, version checks or validated workflows. The objective is to enforce each rule at the layer that can actually observe the required facts. Duplicating rules in screens without protecting the write path is fragile, but assuming a single check constraint can verify an entire commercial process is equally unsafe.

8. How are indexes selected for a busy application?

Start with representative queries, filters, sort orders and expected table sizes. An index that makes a booking lookup faster may impose unnecessary overhead if the column changes frequently or the query already reads most of the table. Consider composite order, selective predicates, join columns and whether the database can avoid sorting. Measure execution plans and actual resource use before and after a change. Also account for write amplification, index storage and the time required to build indexes on live data. Query and index recommendations should be revisited when usage or data distribution changes, rather than treated as a one-time checklist.

9. Why can a query become slow even when indexes already exist?

An index may not match the query's leading predicates, the selected filter may return too many rows, or table statistics may give the planner an inaccurate picture. Complex joins can multiply intermediate results, especially when several one-to-many relationships are combined. Sorting, large offsets, expressions on indexed columns and unexpected tenant-size differences may also matter. Inspect the actual plan against representative values instead of blaming the database engine immediately. Sometimes the best solution is a better query, a narrower result set or a precomputed reporting projection. Adding another index without understanding the plan can increase write cost while leaving the original problem unresolved.

10. What happens if two users edit the same record simultaneously?

The outcome depends on the chosen concurrency policy. An optimistic model can detect that a record's version has changed and require the second user to review the new value. A locked transaction can serialize a narrow critical operation. Stronger isolation can prevent certain anomalies but may produce conflicts that require a complete transaction retry. The business needs to decide whether the second action should wait, fail or merge. For example, two staff members adding comments may be compatible, while two agents spending the same wallet balance require a protected rule. Database isolation and user-facing conflict handling must be designed together.

11. How do you preserve historical pricing and booking changes?

Retain immutable evidence of what was accepted or confirmed at the relevant time, rather than relying only on current catalogue or supplier data. A snapshot may include line-item amounts, currency, policy text or references, and the version of applicable commercial rules. Separately track later changes as amendments, adjustments or events with their actor, source and time. Determine which facts are historical evidence and which can legitimately be corrected. An audit trail should explain the transition, not just store two opaque status codes. Retention and access to this information must follow the agreed product scope, market context and authorised operational purpose.

12. Can a large existing database be migrated without downtime?

Some changes can be introduced while the application continues operating, but zero downtime should not be assumed. Feasibility depends on the engine, table size, query load, lock behaviour, application compatibility and data quality. A staged migration might add new structures, run resumable backfills and temporarily support both representations before removing the old one. High-risk operations need rehearsal, monitoring, a cutover decision and a recovery plan. Large index builds and constraint validation can still create operational pressure even when an engine offers online options. Agree an acceptable maintenance window or risk threshold only after testing the actual environment.

13. What is the difference between a backup and a successful recovery?

A backup is a stored copy or recoverable sequence of database changes. Recovery is the broader process of restoring a usable application state, confirming that critical records are intact and reconciling work performed outside the database. A technically successful restore may lack a recent payment event, an encryption key, connected document storage or an external booking status. Define recovery point and time objectives, then test representative incidents in isolation. Check business workflows and permissions after restoration, not only whether database connections succeed. Document who approves restoration, who coordinates affected integrations and how discrepancies will be investigated.

14. How should database access work in a multi-tenant SaaS platform?

Model tenant ownership consistently and decide how users, agencies, service accounts and support personnel obtain access. Enforce authorisation in business services and, where appropriate, use database-level protections such as restricted roles or row-level policies. Validate joins, exports, background jobs, search indexes and caches because a tenant filter on a primary screen is not enough. Distinguish read permission from authority to issue refunds, edit commercial terms or transfer records. Support access should be time-bounded, traceable and subject to approved procedures. The physical storage model—shared tables, separate schemas or separate databases—should be selected against isolation, operations and migration requirements.

15. What should we provide to begin a database design or redesign discussion?

Share the main business journeys, current application architecture, sample records or an existing schema, known performance complaints, approximate data volumes, integration sources and anticipated growth. Include examples of difficult cases: repeated transactions, inconsistent reports, unresolved external confirmations, access problems or manual reconciliation. Explain which records must remain available for historical or operational reasons, and identify decision makers for business rules. Sensitive production data and credentials are not needed for an initial discussion; sanitised examples are more appropriate. TravelTech365 can review these inputs to define a possible scope through the project enquiry form, with specific capabilities and commitments confirmed during requirements assessment.

Related software services