The main issues that arise with web database design are concurrency and race conditions, schema and data-modeling failures, security exposures such as injection and broken access control, performance and scalability limits, and the operational problems that come from exposing a database to unpredictable internet traffic. These problems interact: a design that "works" in development often fails under concurrent users, partial failures, or hostile input, and the fix usually lies in changing the design rather than patching queries.

"Web database design" is a broad phrase, so a useful answer must separate two things it can mean. It can mean designing the schema and data model of a database that backs a web application, or it can mean designing the overall data layer — schema, access patterns, transactions, caching, replication, and how the application talks to the database. The issues below apply to both, but they differ in emphasis. This answer assumes a conventional relational or document database behind a server-side web application; where a specific database engine, version, or hosting model would change the answer, that is noted as something to verify rather than assumed.

Concurrency and race conditions

A web application is inherently concurrent: many requests arrive at once, often touching the same records. A classic failure is the lost update. Two users load an account balance of $100, each adds $10 in their browser, and each saves a value computed from the stale $100. The second write silently overwrites the first, and $10 vanishes. The schema itself is not wrong; the design failed to include a concurrency-control mechanism — row locking, a transaction with an appropriate isolation level, or optimistic concurrency using a version column that rejects a save based on an outdated version.

A subtler variant is the check-then-act race. Code reads "is this seat available?", pauses (network, rendering, another query), then writes a reservation. Under load, two requests both pass the check. The remedy is to make the check and the write atomic — a conditional UPDATE ... WHERE status = 'available' that succeeds for only one row, or a unique constraint that turns the race into a clean error.

Concurrency problems are easy to miss because they are invisible in single-user testing. A design that omits unique constraints on natural keys (email addresses, usernames, order numbers), or that spreads a single logical operation across multiple autocommit statements, will pass every manual test and then duplicate records or corrupt counters in production.

Schema and data-modeling problems

Several schema-level issues recur in web systems.

Missing or weak constraints. Applications often rely on code to enforce rules that the database could enforce instead. Without NOT NULL, UNIQUE, FOREIGN KEY, and CHECK constraints, bad data accumulates: orphaned rows after a parent is deleted, duplicate signups from retried form submissions, negative quantities. Constraints are also a concurrency defense, since they hold regardless of how many app servers run.

Over-normalization and under-normalization. Fully normalized schemas avoid duplication but can require many joins per page render; denormalized schemas are fast to read but drift out of sync when updates must touch several copies. The design issue is choosing deliberately, and deciding how duplicated values will be kept consistent.

The entity–attribute–value (EAV) trap. Storing arbitrary attributes as rows in a generic (entity_id, attribute, value) table makes the schema flexible but pushes type checking, indexing, and constraints out of the database. Queries become awkward joins, and the database can no longer enforce that price is numeric.

Polymorphic and soft-delete ambiguity. A single comments table referencing both posts and photos via (target_type, target_id) cannot be protected by a normal foreign key, so dangling references become possible. Likewise, "soft delete" flags (deleted_at) are convenient but every query must remember to filter, and unique constraints on "active" rows need partial indexes or careful design.

Date, time, and money handling. Storing timestamps without time zone, mixing local and UTC values, or using floating point for currency causes subtle, hard-to-diagnose errors. These are modeling decisions with long consequences.

Security exposures

Web databases face threats that internal-only databases often do not.

SQL injection remains a leading issue. Concatenating user input into SQL allows an attacker to alter queries, read other users' data, or drop tables. Parameterized queries and prepared statements address this at the design level; string-escaping helpers are fragile by comparison. The same class of problem exists for NoSQL query operators and for ORMs that accept raw fragments.

Broken access control at the data layer. A frequent design flaw is authorizing in the UI but not in the query. If a page hides other users' orders but the API accepts an order_id and returns it without checking ownership, the data is exposed. The design should make ownership part of the query or enforce it in a single data-access layer.

Excessive privilege and shared credentials. An application connecting as a database superuser can do anything a compromised app can. Least-privilege accounts, separate credentials per service, and no direct client-to-database connections are design choices, not afterthoughts.

Sensitive data at rest and in logs. Storing passwords in plaintext or with fast general-purpose hashes, putting personal data in query logs, or backing up unencrypted are common failures. Token and session storage deserves the same scrutiny.

Performance and scalability limits

N+1 query patterns. Loading a list of 50 orders and then issuing one query per order for its line items produces 51 round trips. It works at small scale and collapses under real traffic. The design fix is deliberate eager loading or batched queries.

Missing or misused indexes. Full table scans on large tables, or the opposite — indexing every column so writes slow down and storage balloons. Index design must follow actual query patterns, and those patterns are a design input, not an afterthought.

Unbounded result sets. A query that returns "all matching rows" with no pagination will eventually return millions and exhaust memory. Pagination, keyset pagination for large offsets, and hard limits belong in the design.

Hot rows and contention. A single counter row updated by every request serializes writes and becomes a bottleneck. Sharded counters, append-only event tables, or async aggregation are design-level alternatives.

Operational and lifecycle issues

Schema migrations under load. Web systems cannot pause for long maintenance windows. Migrations that lock large tables, that are not backward-compatible with the running application version, or that cannot be rolled back cause outages. A design that plans for expand-and-contract migrations avoids this.

Caching and staleness. Adding a cache in front of the database improves speed but introduces consistency problems: stale reads, cache stampedes when a popular key expires, and invalidation bugs. The database design and cache design must agree on what staleness is acceptable.

Replication lag. Read replicas reduce load but can serve data seconds behind the primary. A user who writes a record and immediately reloads may not see it. Designs must route read-after-write traffic to the primary or tolerate lag explicitly.

Backups and point-in-time recovery. A design without tested restore procedures is a design with an unverified recovery story. Logical backups, physical backups, and retention policies are operational, but they constrain schema choices (for example, very large single tables complicate restores).

Multi-tenancy. Whether tenants share tables (with a tenant ID and row-level filtering) or get separate schemas or databases affects security isolation, query complexity, and noisy-neighbor performance. Choosing the wrong model early is expensive to reverse.

Where these issues differ and where confusion arises

A common confusion is treating performance problems and correctness problems as the same category. Missing indexes cause slowness; a missing unique constraint causes duplicates. Both are "database design issues," but one is fixed by adding an index and the other by changing the data model, and confusing them leads to wrong fixes — for example, "optimizing" a query that is actually returning wrong results.

Another ambiguity is engine-specific behavior. Transaction isolation levels, locking behavior, and constraint enforcement vary across database systems and even across versions and configuration. A design that is correct under one isolation level may permit anomalies under another; the specific guarantee must be checked against the engine actually deployed rather than assumed from a general description.

Finally, "web" changes the threat model and traffic profile, not the fundamentals. The same normalization, constraint, and transaction principles apply to desktop or internal systems; what the web adds is hostile input, unpredictable concurrency, and the expectation of near-continuous availability. A design that ignores those three realities will fail even if its schema is textbook-correct.