Unit 8 · Session 4
Architectures, Applications, and Cloud Databases
IT 231: IT and Applications (BBA)
Today's focus
- Database System Architectures
- Cloud Database
🎯 Learning Objectives
By the end of this session, you will be able to:
- ✅ Describe 1-tier, 2-tier, and 3-tier database architectures.
- ✅ Explain why the 3-tier architecture is the standard for modern applications.
- ✅ Define cloud databases and Database-as-a-Service (DBaaS).
- ✅ Evaluate the advantages of cloud databases for business.
Database System Architectures
1-Tier Architecture 💻
The database and the application exist on the same physical machine.
- Direct user interaction with the DB.
- Pros: Fast, simple.
- Cons: No network access, poor scalability.
2-Tier Architecture 🖥️ ↔️ 🗄️
A client-server model where the application on the user's machine talks directly to a central database server.
- Pros: Centralized data, fast development.
- Cons: Security risks (direct access), limited scalability for concurrent users.
3-Tier Architecture 📱 ↔️ ⚙️ ↔️ 🗄️
Introduces an "Application Server" middle layer between the user and the database.
- Presentation: User Interface (Web Browser)
- Application: Business Logic (Web Server)
- Database: Data Storage (DBMS)
🔎 Follow One Request Through 3 Tiers
You check your exam result on the university website.
- Presentation tier (your phone's browser): you type your symbol number and tap "Search".
- Application tier (web server): it checks the input is valid and blocks anyone trying to hack the form, then builds a query.
- Data tier (database server): it runs
SELECT ... WHERE SymbolNo = ... and returns your row.
- The application tier formats the result into a web page and sends it back to your phone.
Your phone never talks to the database directly. That's what keeps millions of results safe on result day.
🎬 Client Tier and Logic Tier
Why 3-Tier is the Standard 🏆
- Security: The user never directly accesses the database.
- Scalability: You can add more application servers without touching the database.
- Maintainability: Code is separated logically.
🧪 Activity: 1, 2, or 3 Tier?
1. A shopkeeper's billing software, with the database on the same PC → 1-tier
2. College lab PCs running a desktop attendance app connected straight to a MySQL server in the server room → 2-tier
3. Daraz website → 3-tier
4. A mobile banking app → 3-tier (app → bank's API servers → database)
5. An MS Access file on your personal laptop → 1-tier
🏢 Database Applications in Business
🏦 Finance
Core banking, ATMs, digital wallets, payroll
🛒 Commerce
Point-of-sale (POS), inventory, e-commerce, CRM (customer records)
✈️ Travel
Airline and hotel reservations, ride-sharing
🏥 Health
Patient records, lab results, pharmacy stock
🏛️ Government
Citizenship, passports, land records, tax (PAN), the Nagarik App
🎓 Education
Admissions, exam results, library systems
🌍 Real Case: SABRE, the First Big Booking Database
- 1950s: American Airlines booked seats with index cards and phone calls. A single booking could take up to 90 minutes.
- With IBM, they built SABRE, a computer reservation system that was fully running by 1964.
- Agents across the US could see and book the same seat inventory in seconds.
- Sabre still exists today, and travel agents worldwide use it, including in Nepal.
It was one of the first large real-time transaction systems, which today we call OLTP.
⚖️ OLTP vs OLAP
| OLTP (Online Transaction Processing) | OLAP (Online Analytical Processing) |
| Purpose | Run the business, every day | Analyse the business |
| Typical action | Insert or update one record, fast | Read and summarise millions of records |
| Users | Customers, cashiers, tellers | Managers, analysts |
| Data | Current, detailed | Historical, summarised (a data warehouse) |
| eSewa example | You pay your electricity bill | "Which district paid the most bills last Dashain?" |
🧪 Activity: OLTP or OLAP?
1. ATM withdrawal OLTP
2. Booking a Buddha Air seat OLTP
3. Adding an item to your Daraz cart OLTP
4. Monthly sales report by province OLAP
5. CEO dashboard showing 5-year trends OLAP
6. Which product sells best in which season? OLAP
What is a Cloud Database? ☁️
A database that runs on a cloud computing platform (AWS, Azure, Google Cloud) rather than local on-premises servers.
- Offers the same functionality as traditional DBs.
- Provides incredible flexibility and remote accessibility.
🎬 Inside a Google Data Centre (2012)
Database-as-a-Service (DBaaS) 🛠️
A managed service where the cloud provider handles the database infrastructure, maintenance, and backups.
- Zero Maintenance: The provider handles software patches and hardware upgrades.
- Examples: Amazon RDS, Google Cloud SQL, Firebase.
🤝 Who Does What? On-Premises vs DBaaS
| Task | On-premises | DBaaS (e.g. Amazon RDS) |
| Buy and repair servers | You | Provider |
| Install and patch the DBMS | You | Provider |
| Automatic backups | You | Provider (you choose the settings) |
| Design tables and write queries | You | You |
| Who can access the data | You | You |
The cloud takes away the hardware work, not your responsibility for your data.
Advantages for Business 📈
- Cost Efficiency: Pay only for what you use (no hardware costs).
- Instant Scalability: Add storage or processing power with a single click.
- Disaster Recovery: Data is automatically replicated across multiple geographic zones.
🧮 Worked Example: Own Server or Cloud?
Illustrative figures for a mid-sized online shop over 3 years:
🏢 Own server
- Server and storage: Rs 15,00,000 upfront
- Power, cooling, maintenance: Rs 3,00,000/year
- Total: 15,00,000 + 9,00,000 = Rs 24,00,000
☁️ DBaaS
- Rs 40,000/month, nothing upfront
- 40,000 × 36 = Rs 14,40,000
Your turn: if the shop grows and the bill rises to Rs 70,000/month, which is cheaper? 70,000 × 36 = Rs 25,20,000, so the own server is now cheaper. The cloud is best for starting small or unpredictable demand.
🌍 Real Case: Capital One's Cloud Breach (2019)
- The US bank Capital One stored customer data on Amazon Web Services (AWS).
- A firewall that the bank itself had misconfigured let an attacker reach it. Data on about 100 million people in the US and 6 million in Canada was stolen.
- AWS's own systems were not hacked. US regulators fined Capital One $80 million.
Lesson: Going back to "who does what", access settings are always your job, even in the cloud.
🧪 Activity: Cloud or On-Premises?
1. A new startup app with no idea how many users it will get → Cloud (start small, scale up)
2. An online shop that gets 10× its normal traffic during a Dashain sale → Cloud (pay for the peak only when it happens)
3. A bank whose regulator requires customer data to stay inside the country → On-premises or a local data centre
4. A remote clinic with an unreliable internet connection → A local database, with a cloud backup when it's online
⚡ Key Takeaways
- 1-, 2- and 3-tier architectures differ in where the screen, the logic and the data live. 3-tier is the standard for web and mobile apps.
- Databases power applications in every sector, from banking to government.
- OLTP runs the business, and OLAP analyses it.
- Cloud databases (DBaaS) remove hardware work, but security and data design are still your responsibility.
💬 Discussion Questions
- On exam-result day, the university website often crashes. Which tier is most likely the bottleneck, and how could the cloud help?
- Should a Nepali government service such as the Nagarik App store citizens' data with a foreign cloud provider? Give one argument for and one against.
- Think of an OLAP question that a momo restaurant chain could ask its sales data.
Image & Video Credits
Images
- POS machines of Nepal: Nirjal stha, CC BY-SA 4.0, via Wikimedia Commons
- Overview of a three-tier application: Bartledan (based on a file by Foofy), public domain, via Wikimedia Commons
- Sanfine International Hospital Ward: Wnkwdy, CC BY-SA 4.0, via Wikimedia Commons
- Check-in counters at Suvarnabhumi International Airport: Mattes, CC BY-SA 3.0, via Wikimedia Commons
- OLAP Cube: Konrad Roeder (derivative: Rehua), CC BY-SA 3.0, via Wikimedia Commons
- Data Center of CMC Telecom: Daoducquan, CC BY-SA 4.0, via Wikimedia Commons
- HTTPS and padlock in website address bar: Santeri Viinamäki, CC BY-SA 4.0, via Wikimedia Commons
Videos (YouTube)
- Be A Better Dev, "System Design: What is 3 tier architecture?" (41–123 s)
- Google, "Explore a Google data center with Street View" (2012, 1–90 s)
📖 Related chapter notes
Read first, then revise with this deck: