??? Set the SQL mode to TRADITIONAL. This can be accomplished with the following
command:
SET GLOBAL sql_mode='TRADITIONAL';
This will make MySQL a little bit more strict, raising errors on incorrect data
rather than silently discarding it.
MySQL does have some clear advantages over PostgreSQL in some situations. On
the whole, MySQL tends to be faster. For many web applications, query speed may
be the most important factor. MySQL also has more stable, tested replication and
clustering options available. MySQL is also somewhat better at handling binary data
stored in the database (we discuss this at length later in the chapter). For many web
applications, MySQL may be a clear win.
100 | Chapter 4: Database
SQLite
SQLite is a minimalist database that is excellent for small projects. Although it does
not support many fancy features, it is a great choice for projects that will not grow
very large. It supports ACID transactions* out of the box. SQLite is a library that is
linked into your program; there is no server process to speak of. The library code
residing in your application??™s process space accesses a database file.
SQLite provides no concurrency, as there is no server process to enforce the ACID
properties. Therefore, it uses file-level locking: the entire database file is locked at the
filesystem level during a transaction. Still, for many small applications, it fits the bill
perfectly.
Pages:
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157