- 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/.
- INSTANT Mock Testing with PowerMock
- 計(jì)算思維與算法入門
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- C語(yǔ)言程序設(shè)計(jì)案例教程(第2版)
- Java EE框架整合開發(fā)入門到實(shí)戰(zhàn):Spring+Spring MVC+MyBatis(微課版)
- HTML5+CSS3+JavaScript Web開發(fā)案例教程(在線實(shí)訓(xùn)版)
- 飛槳PaddlePaddle深度學(xué)習(xí)實(shí)戰(zhàn)
- Learning SciPy for Numerical and Scientific Computing(Second Edition)
- UVM實(shí)戰(zhàn)
- Scratch3.0趣味編程動(dòng)手玩:比賽訓(xùn)練營(yíng)
- Maven for Eclipse
- C# 7.0本質(zhì)論
- Laravel Design Patterns and Best Practices
- 網(wǎng)頁(yè)設(shè)計(jì)與制作
- Swift從入門到精通 (移動(dòng)開發(fā)叢書)