SQL Antipatterns

SQL Antipatterns pdf epub mobi txt 电子书 下载 2025

出版者:Pragmatic Bookshelf
作者:Bill Karwin
出品人:
页数:328
译者:
出版时间:2010-7-5
价格:USD 34.95
装帧:Paperback
isbn号码:9781934356555
丛书系列:
图书标签:
  • sql
  • database
  • 数据库
  • SQL
  • Antipatterns
  • Programming
  • 计算机
  • 编程
  • SQL
  • 数据库
  • 设计模式
  • 反模式
  • 性能优化
  • 数据建模
  • SQL Server
  • MySQL
  • PostgreSQL
  • 最佳实践
想要找书就要到 小美书屋
立刻按 ctrl+D收藏本页
你会得到大惊喜!!

具体描述

Each chapter in this book helps you identify, explain, and correct a unique and dangerous antipattern. The four parts of the book group the antipatterns in terms of logical database design, physical database design, queries, and application development.

The chances are good that your application's database layer already contains problems such as Index Shotgun , Keyless Entry , Fear of the Unknown , and Spaghetti Query . This book will help you and your team find them. Even better, it will also show you how to fix them, and how to avoid these and other problems in the future.

SQL Antipatterns gives you a rare glimpse into an SQL expert's playbook. Now you can stamp out these common database errors once and for all.

Whatever platform or programming language you use, whether you're a junior programmer or a Ph.D., SQL Antipatterns will show you how to design and build databases, how to write better database queries, and how to integrate SQL programming with your application like an expert. You'll also learn the best and most current technology for full-text search, how to design code that is resistant to SQL injection attacks, and other techniques for success.

作者简介

Bill Karwin has been a software engineer for over twenty years, developing and supporting applications, libraries, and servers such as Zend Framework for PHP 5, the InterBase relational database, and the Enhydra Java application server. Throughout his career, Bill has shared his knowledge to help other programmers achieve success and productivity. Bill has answered thousands of questions, giving him a unique perspective on SQL mistakes that most commonly cause problems.

目录信息

1 Introduction
1.1 Who This Book Is For
1.2 What’s in This Book
1.3 What’s Not in This Book
1.4 Conventions
1.5 Example Database
1.6 Acknowledgements
Logical Database Design Antipatterns
2 Jaywalking
2.1 Objective: Store Multi-Value Attributes
2.2 Antipattern: Format Comma-Separated Lists
2.3 How to Recognize the Antipattern
2.4 Legitimate Uses of the Antipattern
2.5 Solution: Create an Intersection Table
3 Naive Trees
3.1 Objective: Store and Query Hierarchies
3.2 Antipattern: Always Depend on One’s Parent
3.3 How to Recognize the Antipattern
3.4 Legitimate Uses of the Antipattern
3.5 Solution: Use Alternative Tree Models
4 ID Required
4.1 Objective: Establish Primary Key Conventions
4.2 Antipattern: One Size Fits All
4.3 How to Recognize the Antipattern
4.4 Legitimate Uses of the Antipattern
4.5 Solution:Tailored to Fit
5 Keyless Entry
5.1 Objective: simplify database architecture
5.2 Antipattern: leave out the constraints
5.3 How to Recognize the Antipattern
5.4 Legitimate Uses of the Antipattern
5.5 Solution:declare constraints
6 Entity-Attribute-Value
6.1 Objective: Support Variable Attributes
6.2 Antipattern: Use a Generic Attribute Table
6.3 How to Recognize the Antipattern
6.4 Legitimate Uses of the Antipattern
6.5 Solution:Model the Subtypes
7 Polymorphic Associations
7.1 Objective: Reference Multiple Parents
7.2 Antipattern: Use Dual-Purpose Foreign Key
7.3 How to Recognize the Antipattern
7.4 Legitimate Uses of the Antipattern
7.5 Solution:Simplify the Relationship
8 Multi-Column Attributes
8.1 Objective: Store Multi-Value Attributes
8.2 Antipattern: Create Multiple Columns
8.3 How to Recognize the Antipattern
8.4 Legitimate Uses of the Antipattern
8.5 Solution:Create Dependent Table
9 Metadata Tribbles
9.1 Objective:Support Scalability
9.2 Antipattern:Clone Tables or Columns
9.3 How to Recognize the Antipattern
9.4 Legitimate Uses of the Antipattern
9.5 Solution:Partition and Normalize
II Physical Database Design Antipatterns
10 Rounding Errors
10.1 Objective: Use Fractional Numbers Instead of Integers
10.2 Antipattern:Use FLOAT DataType
10.3 How to Recognize the Antipattern
10.4 Legitimate Uses of the Antipattern
10.5 Solution:Use NUMERIC DataType
11 Flavors
11.1 Objective: Restrict a Column to Specific Values
11.2 Antipattern: Specify Values in the Column Definition
11.3 How to Recognize the Antipattern
11.4 Legitimate Uses of the Antipattern
11.5 Solution:Specify Values in Data
12 Phantom Files
12.1 Objective: Store Images or Other Bulky Media
12.2 Antipattern: Assume You Must Use Files
12.3 How to Recognize the Antipattern
12.4 Legitimate Uses of the Antipattern
12.5 Solution: Use BLOB Data Types As Needed
13 Index Shotgun
13.1 Objective:OptimizePerformance
13.2 Antipattern: Using Indexes Without a Plan
13.3 How to Recognize the Antipattern
13.4 Legitimate Uses of the Antipattern
13.5 Solution:MENTOR Your Indexes
III Query Antipatterns
14 Fear of the Unknown
14.1 Objective: Distinguish Missing Values
14.2 Antipattern: Use Null as Ordinary Value or Vice Versa
14.3 How to Recognize the Antipattern
14.4 Legitimate Uses of the Antipattern
14.5 Solution:Use Null as a Unique Value
15 Ambiguous Groups
15.1 Objective: Get Row with Greatest Value per Group
15.2 Antipattern: Reference Non-Grouped Columns
15.3 How to Recognize the Antipattern
15.4 Legitimate Uses of the Antipattern
15.5 Solution: Use Columns Unambiguously
16 Random Selection
16.1 Objective:FetchASampleRow
16.2 Antipattern:SortDataRandomly
16.3 How to Recognize the Antipattern
16.4 Legitimate Uses of the Antipattern
16.5 Solution:In No Particular Order
17 Poor Man’s Search Engine
17.1 Objective:FullTextSearch
17.2 Antipattern: Pattern Matching Predicates
17.3 How to Recognize the Antipattern
17.4 Legitimate Uses of the Antipattern
17.5 Solution:Use the Right Tool for the Job
18 Spaghetti Query
18.1 Objective:DecreaseSQLQueries
18.2 Antipattern: Solve a Complex Problem in One Step
18.3 How to Recognize the Antipattern
18.4 Legitimate Uses of the Antipattern
18.5 Solution:Divide and Conquer
19 Implicit Columns
19.1 Objective:ReduceTyping
19.2 Antipattern: a Short Cut That Gets You Lost
19.3 How to Recognize the Antipattern
19.4 Legitimate Uses of the Antipattern
19.5 Solution:Name Columns Explicitly
IV Application Development Antipatterns
20 Readable Passwords
20.1 Objective: Recover or Reset Passwords
20.2 Antipattern: Store Password in Plain Text
20.3 How to Recognize the Antipattern
20.4 Legitimate Uses of the Antipattern
20.5 Solution: Store a Salted Hash of the Password
21 SQL Injection
21.1 Objective: Write Dynamic SQL Queries
21.2 Antipattern: Execute Unverified Input As Code
21.3 How to Recognize the Antipattern
21.4 Legitimate Uses of the Antipattern
21.5 Solution:Trust No One
22 Pseudokey Neat-Freak
22.1 Objective:Tidy Up the Data
22.2 Antipattern:Filling in the Corners
22.3 How to Recognize the Antipattern
22.4 Legitimate Uses of the Antipattern
22.5 Solution:Get Over It
23 See No Evil
23.1 Objective:Write Less Code
23.2 Antipattern: Making Bricks Without Straw
23.3 How to Recognize the Antipattern
23.4 Legitimate Uses of the Antipattern
23.5 Solution: Recover from Errors Gracefully
24 Diplomatic Immunity
24.1 Objective:Employ Best Practices
24.2 Antipattern: Make SQL a Second-Class Citizen
24.3 How to Recognize the Antipattern
24.4 Legitimate Uses of the Antipattern
24.5 Solution: Establish a Big-Tent Culture of Quality
25 Magic Beans
25.1 Objective:Simplify Mode ls in MVC
25.2 Antipattern: The Model Is an Active Record
25.3 How to Recognize the Antipattern
25.4 Legitimate Uses of the Antipattern
25.5 Solution: The Model Has an Active Record
V Appendixes
A Rules of Normalization
A.1 What Does Relational Mean?
A.2 Myths About Normalization
A.3 What Is Normalization?
A.4 Common Sense
B Bibliography
Index
· · · · · · (收起)

读后感

评分

《SQL反模式》,英文版2010年7月出版,中文版2011年9月出版。还算比较新。英文名:“SQL Antipatterns: Avoiding the Pitfalls of Database Programming”(SQL反模式:避免数据库开发中的陷阱)。 所谓反模式,就是做的不好的模式。也就是前人的经验教训。 感觉作者功力比较高...  

评分

1 看书名,我以为是这本书是讲如何突破以前SQL设计的老模式,讲一些新颖的技术,并且取了一个名字叫反模式。但其实正好相反,它是维护老模式的,反模式确实是书的主要内容,它罗列一些SQL程序员经常会犯的错误,这些错误违反了SQL模式。 2 本书结构是,先从一个实际场景引进一...  

评分

1 看书名,我以为是这本书是讲如何突破以前SQL设计的老模式,讲一些新颖的技术,并且取了一个名字叫反模式。但其实正好相反,它是维护老模式的,反模式确实是书的主要内容,它罗列一些SQL程序员经常会犯的错误,这些错误违反了SQL模式。 2 本书结构是,先从一个实际场景引进一...  

评分

这本书讲的东西,只有维护过一堆烂代码和槽糕的数据库设计的人才能体会。 至少没有外键,也不设主键的系统我是见过的 本书讨论的主题是非常实用的,而且是开发中的一些重要问题 比如树形结构,随机行选取,外键的使用,密码的存储,文件的存储等等 作者总体来说是把数据一致性...

评分

《SQL反模式》,英文版2010年7月出版,中文版2011年9月出版。还算比较新。英文名:“SQL Antipatterns: Avoiding the Pitfalls of Database Programming”(SQL反模式:避免数据库开发中的陷阱)。 所谓反模式,就是做的不好的模式。也就是前人的经验教训。 感觉作者功力比较高...  

用户评价

评分

讲数据库层的设计模式,讲应用层与数据库层之间的结合开发。 把很多在面向对象设计中的思想融入到关系型数据库的应用开发上。

评分

第一部分8章最重要,很实用,其它的选看。

评分

所谓的反模式就是开发过程中经常会走进的误区或者说不好的实践,书中指出这些用法会带来哪些问题,在什么情况下使用才算合理,最后给出最佳实践,并解释清楚。尤其最后一章深入挖掘MVC模式中Model的真正含义,非常受用,我算是彻底明白为什么Laravel默认的目录结构里没有Models目录,是因为很多程序员对Model的作用有争议,所以框架把决定权交给程序员。强烈建议每个程序员都读读此书,尤其是PHP程序员,书中的应用程序层的代码示例就是PHP的

评分

“You can't learn from these mistakes.“ 我觉得里面的反模式真的都好好笑。

评分

第一部分8章最重要,很实用,其它的选看。

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美书屋 版权所有