This notebook is a quick introduction of how to setup and use a relational database by using python toolkit called SQLAlchemy.
A relational database store data in tables. Each table contains rows and columns. Most relational database systems use Structured Query Language (SQL) as the language for querying and maintaining the database. There are many commercial and open-source Relational Database Management System (RDMS) such as Oracle, IBM, MySQL and PostgreSQL.
These are some advantages of using relational database system over flat files format (CSV-format): database vs. flat files
- Databases can handle complitated queries without going though the whole file.
- Databases can handle indexing tasks (e.g. search index == something )
- Databases can update data easily
- Databases can scale effortlessly
- postgresql
- sqlalchemy
- psycopg2
- Amazon Web Services DB Instance
First, install PostgreSQL from the following page.
Second, to install python dependencies, run
pip install psycopg2 sqlalchemy sqlalchemy_utils
Then, AWS DB Instance from this page and setup DB instance with PostgreSQL. Keep in mind that creating a new DB instance can take between 10 to 20 mins. From this, username, password, port (default=5432) and host will be obtained. Host address will be like
******.us-west-2.rds.amazonaws.com