CSS Prepare

optional · CSS study notes

11. Data Aspect Architectures

CSS Optional — Paper-II, Section-B · P-II.VI.11 · Kappel's third architecture category: how a web application stores, accesses and delivers different kinds of data.

1. Kinds of Data in Web Applications

KindDescriptionExamplesTypical storage
StructuredFixed schema, rows and columnsOrders, students, accountsRelational DB (MySQL, PostgreSQL, Oracle)
Semi-structuredSelf-describing, flexible schemaXML, JSON documents, RSS feeds, logsDocument DBs (MongoDB), XML databases
UnstructuredNo predefined structureWeb pages, articles, PDFsFile systems, CMS repositories, search indexes
MultimediaLarge binary, time-basedImages, audio, videoObject storage (S3), streaming servers, CDN

2. Kappel's Data-Aspect Architectures

(a) Database-centric architectures — structured data in a DBMS accessed by the application server.

  • Access techniques: CGI scripts → server-side scripting (PHP, JSP) → database drivers/APIs (ODBC, JDBC, PHP PDO) → ORM (Eloquent, Hibernate) mapping objects to tables.
  • Features used: transactions (ACID), connection pooling, stored procedures, indexes.

(b) Architectures for web document management — unstructured/semi-structured content.

  • Content Management Systems (CMS): WordPress, Drupal, Joomla — separate content (stored in a repository/DB) from presentation (templates); workflow for authoring, approval and publishing; versioning.
  • Headless CMS: content served through APIs to any front end.
  • Search engines/indexes (Elasticsearch) for full-text retrieval.

(c) Architectures for multimedia data

  • Download: whole file transferred before playing.
  • Progressive download: playback starts while downloading (HTTP).
  • Streaming: media sent in real time via streaming servers/protocols (HLS, MPEG-DASH, RTMP/RTSP).
  • Adaptive bitrate streaming: quality switches automatically with bandwidth (YouTube, Netflix).
  • CDNs cache media near users.

3. Static vs Dynamic Content Generation

ApproachHowUse
StaticPre-built HTML filesRarely changing content
Dynamic on requestPage built from DB for each requestPersonalized, frequently changing data
Pre-generation / cachingPages generated when data changes, then served staticallyNews sites, catalogues — best of both

4. Scaling the Data Tier

  • Caching: in-memory (Redis, Memcached), query caching, full-page caching.
  • Replication: master–replica; writes to master, reads spread across replicas.
  • Sharding / partitioning: split data across servers by key (e.g. user ID).
  • Indexing for fast lookups.
  • Polyglot persistence: use SQL for transactions, NoSQL for sessions/catalogue, search engine for text, object storage for media.
  • CAP theorem: a distributed store can guarantee only two of Consistency, Availability and Partition tolerance under a network partition — relevant when choosing NoSQL systems.

5. SQL vs NoSQL (for web apps)

PointSQL (relational)NoSQL
SchemaFixedFlexible
ScalingMainly vertical (read replicas)Horizontal by design
ConsistencyStrong ACIDOften eventual (BASE)
Best forBanking, orders, complex joinsLarge-scale feeds, sessions, catalogues, logs

🎯 CSS Exam Angle

Classify data (structured, semi-, unstructured, multimedia) → map each to Kappel's architecture (database-centric, document management, multimedia) → add scaling techniques. A table does most of the work.

⚠️ MCQ Traps

  • JSON and XML are semi-structured data.
  • Progressive download is not true streaming.
  • Replication improves reads and availability; sharding improves write scalability and size.
  • A CMS separates content from presentation.

✅ Self-Check (with Answers)

Q1. Name Kappel's three data-aspect architectures.

Ans: Database-centric architectures, architectures for web document management, and architectures for multimedia data.

Q2. What is adaptive bitrate streaming?

Ans: Video is encoded at several quality levels split into small segments; the player switches between qualities segment by segment according to current bandwidth, avoiding buffering (HLS, MPEG-DASH).

Q3. Why use an ORM, and what is its drawback?

Ans: It maps database tables to objects, reducing boilerplate SQL, improving portability and protecting against SQL injection through parameterization. Drawback: can generate inefficient queries and hides performance details.

Q4. A news site gets millions of reads but few writes. Which data-tier techniques help?

Ans: Page and object caching (Redis/CDN), read replicas, and pre-generating article pages when they change.

Q5. Classify: product table, product description in JSON, user-uploaded video, blog article.

Ans: Structured; semi-structured; multimedia; unstructured.

📜 Past-Paper Questions & MCQs (CSS 2016–2026)

2024 · Paper-II · Q8(b) · 7 marks

Q. Discuss data aspect architectures in web development. How do these architectures address challenges related to data storage, retrieval and management?

Ans.

  • The data aspect of a web application covers how data (content, user data, transactions) is stored, accessed and managed. Architectures include:
    • Database-centric (relational) architecture: the application stores data in an RDBMS and uses SQL.
    • Content-centric / document architecture: XML or JSON documents and content-management systems.
    • NoSQL and polyglot persistence: key-value, document, column or graph stores chosen for each need.
    • Layered data access: DAO or repository patterns and ORM tools separate business logic from storage.
    • Caching, replication and sharding: Redis or Memcached, read replicas and partitioned databases.
    • Data warehouse / CQRS: separate read and write models for analytics.
  • How they address the challenges:
    • Storage: choose the right store, partition (shard) for volume, and use cloud storage.
    • Retrieval: indexes, caching and CDNs for speed, and query optimisation.
    • Management: backups, replication and failover for availability, transactions for consistency, access control and encryption for security, and schema migration for change.
  • Trade-off: consistency versus availability and scale (CAP), and complexity versus performance.