- Learning Flask Framework
- Matt Copperwaite Charles Leifer
- 331字
- 2021-07-30 10:18:34
Why use a relational database?
Our application's database is much more than a simple record of things that we need to save for future retrieval. If all we needed to do was save and retrieve data, we could easily use flat text files. The fact is, though, that we want to be able to perform interesting queries on our data. What's more, we want to do this efficiently and without reinventing the wheel. While non-relational databases (sometimes known as NoSQL databases) are very popular and have their place in the world of the web, relational databases long ago solved the common problems of filtering, sorting, aggregating, and joining tabular data. Relational databases allow us to define sets of data in a structured way that maintains the consistency of our data. Using relational databases also gives us, the developers, the freedom to focus on the parts of our app that matter.
In addition to efficiently performing ad hoc queries, a relational database server will also do the following:
- Ensure that our data conforms to the rules set forth in the schema
- Allow multiple people to access the database concurrently, while at the same time guaranteeing the consistency of the underlying data
- Ensure that data, once saved, is not lost even in the event of an application crash
Relational databases and SQL, the programming language used with relational databases, are topics worthy of an entire book. Because this book is devoted to teaching you how to build apps with Flask, I will show you how to use a tool that has been widely adopted by the Python community for working with databases, namely, SQLAlchemy.
Note
SQLAlchemy abstracts away many of the complications of writing SQL queries, but there is no substitute for a deep understanding of SQL and the relational model. For that reason, if you are new to SQL, I would recommend that you check out the colorful book Learn SQL the Hard Way, Zed Shaw available online for free at http://sql.learncodethehardway.org/.
- 自己動(dòng)手實(shí)現(xiàn)Lua:虛擬機(jī)、編譯器和標(biāo)準(zhǔn)庫(kù)
- Learning Informatica PowerCenter 10.x(Second Edition)
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲(chóng)案例實(shí)戰(zhàn)全流程詳解(高級(jí)進(jìn)階篇)
- 智能手機(jī)故障檢測(cè)與維修從入門(mén)到精通
- Python開(kāi)發(fā)基礎(chǔ)
- 監(jiān)控的藝術(shù):云原生時(shí)代的監(jiān)控框架
- 從零開(kāi)始學(xué)Selenium自動(dòng)化測(cè)試:基于Python:視頻教學(xué)版
- C語(yǔ)言從入門(mén)到精通
- WordPress Search Engine Optimization(Second Edition)
- Learning TypeScript
- HTML5程序設(shè)計(jì)基礎(chǔ)教程
- Learning Redis
- Python AI游戲編程入門(mén):基于Pygame和PyTorch
- Prezi Cookbook
- 開(kāi)源心法