Skip to content

Commit 08cefe1

Browse files
committed
converting databases to md
1 parent 83e1365 commit 08cefe1

File tree

3 files changed

+204
-74
lines changed

3 files changed

+204
-74
lines changed

databases.html

Lines changed: 64 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -74,124 +74,115 @@
7474
</div>
7575
<div class="row">
7676
<div class="col-md-8">
77-
<div class="section" id="id1">
78-
<h2>Databases</h2>
79-
<p>A database is an abstraction on top of an operating system's file system to
80-
ease creating, reading, updating, and deleting persistent data. The
77+
<h1>Databases</h1>
78+
<p>A database is an abstraction on top of an operating system's file system to
79+
ease creating, reading, updating, and deleting persistent data. The
8180
database storage abstraction most commonly used in Python web development is
8281
sets of relational tables. Alternative storage abstractions are explained in
83-
the <a class="reference external" href="../no-sql-datastore.html">NoSQL</a> section of this guide.</p>
82+
the <a href="../no-sql-datastore.html">NoSQL</a> section of this guide.</p>
8483
<p>Relational databases store all data in a series of tables. Interconnections
8584
between the tables are specified as <em>foreign keys</em>.</p>
86-
<p>Databases storage implementations vary in complexity. SQLite, a database
87-
included with Python, creates a single file for all data per database.
85+
<p>Databases storage implementations vary in complexity. SQLite, a database
86+
included with Python, creates a single file for all data per database.
8887
Other databases such as Oracle, PostgreSQL, and MySQL have more complicated
89-
persistence schemes while offering additional advanced features that are
88+
persistence schemes while offering additional advanced features that are
9089
useful for web application data storage.</p>
91-
<p><a class="reference external" href="http://www.postgresql.org/">PostgreSQL</a> and
92-
<a class="reference external" href="http://www.mysql.com/">MySQL</a> are two of the most common open source
90+
<p><a href="http://www.postgresql.org/">PostgreSQL</a> and
91+
<a href="http://www.mysql.com/">MySQL</a> are two of the most common open source
9392
databases for storing Python web application data.</p>
94-
<p><a class="reference external" href="http://www.sqlite.org/">SQLite</a> is a database that is stored in a single
93+
<p><a href="http://www.sqlite.org/">SQLite</a> is a database that is stored in a single
9594
file on disk. SQLite is built into Python but is only built for access
9695
by a single connection at a time. Therefore is highly recommended to not
97-
<a class="reference external" href="https://docs.djangoproject.com/en/dev/ref/databases/#database-is-locked-errors">run a production web application with SQLite</a>.</p>
98-
</div>
99-
<div class="section" id="id2">
96+
<a href="https://docs.djangoproject.com/en/dev/ref/databases/#database-is-locked-errors">run a production web application with SQLite</a>.</p>
10097
<h2>PostgreSQL</h2>
10198
<p>PostgreSQL is the recommended relational database for working with Python
10299
web applications. PostgreSQL's feature set, active development and stability
103100
contribute to its usage as the backend for millions of applications live
104101
on the Web today.</p>
105-
<div class="section" id="postgresql-resources">
106102
<h3>PostgreSQL resources</h3>
107-
<p>This post on &quot;<a class="reference external" href="http://killtheyak.com/use-postgresql-with-django-flask/">Use PostgreSQL with Django or Flask</a>&quot;
103+
<p>This post on
104+
<a href="http://killtheyak.com/use-postgresql-with-django-flask/">using PostgreSQL with Django or Flask</a>
108105
is a great quickstart guide for either framework.</p>
109-
<p><a class="reference external" href="http://postgresweekly.com/">PostgreSQL Weekly</a> is a weekly newsletter of
106+
<p><a href="http://postgresweekly.com/">PostgreSQL Weekly</a> is a weekly newsletter of
110107
PostgreSQL content from around the web.</p>
111-
<p><a class="reference external" href="https://www.braintreepayments.com/braintrust/scaling-postgresql-at-braintree-four-years-of-evolution">Scaling PostgreSQL at Braintree</a>. Fascinating
112-
inside look at the evolution of the database's usage at Braintree.</p>
113-
<p><a class="reference external" href="http://www.ibm.com/developerworks/library/os-postgresecurity/">Total security in a PostgreSQL database</a>.
108+
<p>Braintree wrote about their experiences <a href="https://www.braintreepayments.com/braintrust/scaling-postgresql-at-braintree-four-years-of-evolution">scaling PostgreSQL</a>.
109+
The post is an inside look at the evolution of Braintree's usage of the database.</p>
110+
<p>There's no such thing as total security but this IBM article covers
111+
<a href="http://www.ibm.com/developerworks/library/os-postgresecurity/">hardening a PostgreSQL database</a>.
114112
There is no such thing as total security but this is a good article anyway.</p>
115-
<p><a class="reference external" href="http://www.craigkerstiens.com/2012/10/01/understanding-postgres-performance/">Understanding PostgreSQL performance</a></p>
116-
<p><a class="reference external" href="http://instagram-engineering.tumblr.com/post/40781627982/handling-growth-with-postgres-5-tips-from-instagram">Handling growth with Postgres</a>
113+
<p>Craig Kerstien's wrote a detailed post about <a href="http://www.craigkerstiens.com/2012/10/01/understanding-postgres-performance/">understanding PostgreSQL performance</a>.</p>
114+
<p><a href="http://instagram-engineering.tumblr.com/post/40781627982/handling-growth-with-postgres-5-tips-from-instagram">Handling growth with Postgres</a>
117115
provides 5 specific tips from Instagram's engineering team on how to scale
118116
the design of your PostgreSQL database.</p>
119-
</div>
120-
</div>
121-
<div class="section" id="id3">
122117
<h2>MySQL</h2>
123-
<p>MySQL is another viable open source database backend option for Python web
124-
applications. MySQL has a slightly easier initial learning curve than
125-
PostgreSQL. The database is deployed in production at some of the highest
126-
trafficked sites such as
127-
<a class="reference external" href="https://blog.twitter.com/2012/mysql-twitter">Twitter</a>,
128-
<a class="reference external" href="https://www.facebook.com/notes/facebook-engineering/mysql-and-database-engineering-mark-callaghan/10150599729938920">Facebook</a>
129-
and <a class="reference external" href="http://www.mysql.com/customers/">many others major organizations</a>.
130-
However, since the company focused on MySQL development,
131-
<a class="reference external" href="http://en.wikipedia.org/wiki/MySQL_AB">MySQL AB</a>, was
118+
<p>MySQL is another viable open source database backend option for Python web
119+
applications. MySQL has a slightly easier initial learning curve than
120+
PostgreSQL. The database is deployed in production at some of the highest
121+
trafficked sites such as
122+
<a href="https://blog.twitter.com/2012/mysql-twitter">Twitter</a>,
123+
<a href="https://www.facebook.com/notes/facebook-engineering/mysql-and-database-engineering-mark-callaghan/10150599729938920">Facebook</a>
124+
and <a href="http://www.mysql.com/customers/">many others major organizations</a>.
125+
However, since the company focused on MySQL development,
126+
<a href="http://en.wikipedia.org/wiki/MySQL_AB">MySQL AB</a>, was
132127
purchased by Sun Microsystems (which was in turn purchased by Oracle), there
133128
have been major defections away from the database by
134-
<a class="reference external" href="http://www.zdnet.com/wikipedia-moving-from-mysql-to-mariadb-7000008912/">Wikipedia</a>
135-
and <a class="reference external" href="http://readwrite.com/2013/09/14/google-waves-goodbye-to-mysql-in-favor-of-mariadb">Google</a>.
136-
MySQL remains a viable database option but I always recommend new Python
129+
<a href="http://www.zdnet.com/wikipedia-moving-from-mysql-to-mariadb-7000008912/">Wikipedia</a>
130+
and <a href="http://readwrite.com/2013/09/14/google-waves-goodbye-to-mysql-in-favor-of-mariadb">Google</a>.
131+
MySQL remains a viable database option but I always recommend new Python
137132
developers learn PostgreSQL if they do not already know MySQL.</p>
138-
<div class="section" id="mysql-resources">
139133
<h3>MySQL resources</h3>
140-
<p><a class="reference external" href="http://designm.ag/tutorials/28-beginners-tutorials-for-learning-about-mysql-databases/">28 Beginner's Tutorials for Learning about MySQL Databases</a>
134+
<p><a href="http://designm.ag/tutorials/28-beginners-tutorials-for-learning-about-mysql-databases/">28 Beginner's Tutorials for Learning about MySQL Databases</a>
141135
is a curated collection on various introductory MySQL topics.</p>
142-
<p>This tutorial shows how to install <a class="reference external" href="http://www.cs.wcupa.edu/rkline/index/mysql-lin.html">MySQL on Ubuntu</a>.</p>
143-
</div>
144-
</div>
145-
<div class="section" id="connecting-to-a-database-with-python">
136+
<p>This tutorial shows how to install <a href="http://www.cs.wcupa.edu/rkline/index/mysql-lin.html">MySQL on Ubuntu</a>.</p>
146137
<h2>Connecting to a database with Python</h2>
147-
<p>To work with a relational database using Python, you need to use a code
138+
<p>To work with a relational database using Python, you need to use a code
148139
library. The most common libraries for relational databases are:</p>
149-
<p><a class="reference external" href="http://initd.org/psycopg/">psycopg2</a> for PostgreSQL</p>
150-
<p><a class="reference external" href="https://pypi.python.org/pypi/MySQL-python/1.2.4">MySQLdb</a> for MySQL</p>
151-
<p><a class="reference external" href="http://cx-oracle.sourceforge.net/">cx_Oracle</a> for Oracle</p>
140+
<ul>
141+
<li>
142+
<p><a href="http://initd.org/psycopg/">psycopg2</a> for PostgreSQL</p>
143+
</li>
144+
<li>
145+
<p><a href="https://pypi.python.org/pypi/MySQL-python/1.2.4">MySQLdb</a> for MySQL</p>
146+
</li>
147+
<li>
148+
<p><a href="http://cx-oracle.sourceforge.net/">cx_Oracle</a> for Oracle</p>
149+
</li>
150+
</ul>
152151
<p>SQLite support is built into Python 2.7+ and therefore a separate library
153-
is not necessary. Simply &quot;import sqlite3&quot; to begin interfacing with the
152+
is not necessary. Simply "import sqlite3" to begin interfacing with the
154153
single file-based database.</p>
155-
</div>
156-
<div class="section" id="object-relational-mapping">
157154
<h2>Object-Relational Mapping</h2>
158-
<p>Object-relational mappers (ORMs) allow developers to access data from a
159-
backend by writing Python code instead of SQL queries. Each web
160-
application framework handles integrating ORMs differently.</p>
161-
<p>Django provides an ORM with its core functionality. Flask leaves using an
162-
ORM up to an extension, such as
163-
<a class="reference external" href="http://pythonhosted.org/Flask-SQLAlchemy/">Flask-SQLALchemy</a>.</p>
155+
<p>Object-relational mappers (ORMs) allow developers to access data from a
156+
backend by writing Python code instead of SQL queries. Each web
157+
application framework handles integrating ORMs differently. </p>
158+
<p>Django provides an ORM with its core functionality. Flask leaves using an
159+
ORM up to an extension, such as
160+
<a href="http://pythonhosted.org/Flask-SQLAlchemy/">Flask-SQLALchemy</a>. </p>
164161
<p>Developers can also use ORMs without a web framework, such as when
165-
creating a data analysis tool or a batch script without a user interface.
162+
creating a data analysis tool or a batch script without a user interface.
166163
Currently, the most widely used stand-alone ORM written for Python is
167-
<a class="reference external" href="http://www.sqlalchemy.org/">SQLAlchemy</a>.</p>
168-
</div>
169-
<div class="section" id="database-third-party-services">
164+
<a href="http://www.sqlalchemy.org/">SQLAlchemy</a>.</p>
170165
<h2>Database third-party services</h2>
171-
<p>Numerous companies run scalable database servers as a hosted service.
172-
Depending on the provider, there can be several advantages to using a
166+
<p>Numerous companies run scalable database servers as a hosted service.
167+
Depending on the provider, there can be several advantages to using a
173168
hosted database third-party service:</p>
174-
<ol class="arabic simple">
169+
<ol>
175170
<li>automated backups and recovery</li>
176171
<li>tightened security configurations</li>
177172
<li>easy vertical scaling</li>
178173
</ol>
179-
<p><a class="reference external" href="http://aws.amazon.com/rds/">Amazon Relational Database Service (RDS)</a>
174+
<p><a href="http://aws.amazon.com/rds/">Amazon Relational Database Service (RDS)</a>
180175
provides pre-configured MySQL and PostgreSQL instances. The instances can
181176
be scaled to larger or smaller configurations based on storage and performance
182177
needs.</p>
183-
<p><a class="reference external" href="https://developers.google.com/cloud-sql/">Google Cloud SQL</a> is a service
178+
<p><a href="https://developers.google.com/cloud-sql/">Google Cloud SQL</a> is a service
184179
with managed, backed up, replicated, and auto-patched MySQL instances. Cloud
185180
SQL integrates with Google App Engine but can be used independently as well.</p>
186-
<div class="section" id="database-resources">
187-
<h3>Database resources</h3>
188-
<p><a class="reference external" href="http://db-engines.com/en/ranking">DB-Engines</a> ranks the most popular
181+
<h2>Database resources</h2>
182+
<p><a href="http://db-engines.com/en/ranking">DB-Engines</a> ranks the most popular
189183
database management systems.</p>
190-
<p><a class="reference external" href="http://dbweekly.com/">DB Weekly</a> is a new (as of Feb 2014) weekly roundup
191-
of general database articles and resources.</p>
192-
</div>
193-
</div>
194-
184+
<p><a href="http://dbweekly.com/">DB Weekly</a> is a weekly roundup of general database
185+
articles and resources.</p>
195186
<br/>
196187
Next read the
197188
<a href="/wsgi-servers.html">wsgi servers</a> section.

feeds/all.atom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2014-02-25T07:58:46Z</updated></feed>
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>Matt Makai</title><link href="http://www.fullstackpython.com/" rel="alternate"></link><link href="http://www.fullstackpython.com/feeds/all.atom.xml" rel="self"></link><id>http://www.fullstackpython.com/</id><updated>2014-02-25T17:54:12Z</updated></feed>

0 commit comments

Comments
 (0)