PostgreSQL – Week 1 of 7 Databases in 7 Weeks

by Buddy Lindsey on January 30, 2012

Relational Databases are great databases, and a good staple of any development stack when flexible querying ability is needed. Currently my main RDBMS is MySQL, but since the acquisition by Oracle I have been a bit turned off by it. Something always rubbed the wrong way as it was, but the purchase made me really want to move away. However, I never knew to what, or what to read to decide. This first chapter sealed the deal on my move to PostgreSQL for all non-wordpress and future projects.

Impressions of the Book

As noted above knowing what to read about PostgreSQL has been hard, but the book nailed what I wanted to know. I don’t really care too much about SQL Syntax, but what I wanted was more of the nitty gritty of how it worked along with what array of abilities it has. I got that and then some.

While some of the content was over my head because I have never had to deal with that kind of data storage and retrieval I could really see the flexibility incase I need to go there. The best part of the chapter is it was a deep dive with all the assumptions that I knew what I was doing with an RDBMS which allowed the content to be more specific.

What I Learned

For this database this section is going to be a bit small because I am used to RDBMS’s, but that doesn’t mean I didn’t learn anything. There are 3 key things that suck out in my head the most which I like, but are probably trivial to many other people. These might be in other database engines, I don’t know.

Sub Selection

I had never thought about this before, but this is a great way to keep referential integrity without having to lookup id’s everywhere. Here is the code that drew my attention to it.

INSERT INTO events (title, starts, ends, venue_id)
VALUES ('Mobi', '2012-02-06 21:00', '2012-02-06 23:00', (
     SELECT venue_id FROM venues WHERE name = 'Crystal Ballroom'
)

LIKEs

I specifically liked ILIKE which is case insensitive like vs a case sensitive LIKE. I have not seen this before and I remember running into an issue in the past, not sure what RDBMS, where I wanted all uppercase only, but kept getting mixed results. It is cool there is a distinction.

Extensibility

To be honest I had never thought about writing, or having, extra functionality in a database engine before from 3rd parties. This chapter not only showed me you can, but there is a lot of power in using them.

Overall

Chapter 1 was a great read, easy to follow and witty. Good amount of information in a short amount of time with not much fluff. It was a fairly deep dive as advertised for one reasonably length’d chapter. I really liked in the wrap-up where they talked about the strengths and weaknesses of PostgreSQL. However, I can only hope they expand on what they said in the weakness section in later chapters by detailing out how to use non-relational data.

I have high hopes for the future chapters as I was quite impressed by this first one. Join me next time for Riak.

Related Posts:

{ 1 comment }

7 Databases in 7 Weeks – 8 Week Review and Experience

by Buddy Lindsey on January 23, 2012

7 Databases in 7 Weeks

Databases are annoying and generally suck. Many us developers prefer to just do stuff with data and don’t like to deal with storing data beyond a nice pretty api. However, to be an effective software developer we also understand knowing about databases is a smart idea, doesn’t mean we have to like it.

One of the biggest problems for me is I don’t really know a lot about data stores outside of RDBMS’s. NoSQL data stores do not generally make a lot of sense to me, I know about them technically, but I haven’t found (m)any good overviews which help things click on proper ways to use them. It is my hope that reading 7 Databases in 7 Weeks will be that final piece of knowledge which helps everything click into place.

A Note

I feel I should note before moving on this book is still in beta so things can, and will probably change. Most of the book covers different NoSQL databases so with my limited knowledge anything is better than nothing. I just wanted to be sure to point out as of now the book is in beta, but that doesn’t mean it is wrong or bad.

What to Expect

Over the course of the next 7 weeks I will take one database at a time and do all the exercises, to the best of my ability, and read the entire chapter. I will then describe what I have learned and what, if anything, really helped things click in my head. Finally, on week 8 I will do a wrap-up of everything I have read and my opinion of the book.

What is In the Book

Databases of course ;) . The book is broken up into the following databases:

  1. PostgreSQL
  2. Riak
  3. HBase
  4. MongoDB
  5. CouchDB
  6. Neo4J
  7. Redis

Each database will get its own post so I can do them justice. Especially since there are several different types of databases.

What I Hope to Get Out of The Book

I mostly use RDBMS’s, namely mysql, but I need to learn NoSQL, and want to learn PostgreSQL, if for nothing else to know when and where to use it. I don’t want to just use it because I can, but because I should. In the first chapter, which was an overview, this is what they promise and I think they will deliver. I don’t intend to be an expert in each database, but at least have a working knowledge of them to combat my database ignorance.

Please comeback next week for the first part on PostgreSQL.

Related Posts:

{ 5 comments }

Getting Started with Twitter Bootstrap

January 16, 2012

If you are a developer like me you can write code, but design is not one of your strong points. You probably don’t mind too much, but would like demo apps and test stuff to look a bit better. Well Bootstrap can be used for just that. However, at least for me, when you go [...]

Read the full article →

HTML5 Local Storage Intro

January 9, 2012

HTML5 local storage is a really cool feature which is super easy to use and fairly useful, especially for your HTML5 web applications. I have recently started using it for a few items here and there and am impressed with how versatile it is. Storing Data Local storage is a key value pair based storage [...]

Read the full article →

Reviewing 2011 the Year that Changed Everything for Me

January 6, 2012

I can honestly say that over the last year I have gone from a beginnermediate developer to an intermediate developer. This was something that was most definitely hard won, but thoroughly pleasing. I just hope the quantity of stuff I have learned in the last year and half will hold through the next year. Lets [...]

Read the full article →

Check Your JavaScript for Syntax Errors Outside the Browser

December 19, 2011

Writing JavaScript can really suck when you have simple syntax errors. Often you have to refresh the page, in a browser, to make sure the code is syntactically correct. Working more with JavaScript, especially PhoneGap, making sure the syntax is correct before even bothering to run the JavaScript code is a must since it takes [...]

Read the full article →

Hosting Your Open Source Project on Heroku with Private Configuration

December 12, 2011

My first major open source application, the GoDjango site, is teaching me a lot about deployment and maintaining secrecy of custom configuration like username/passwords and api keys. I don’t want them to get into the main branch of the GoDjango github repo, but I want to minimize pain while pushing to heroku and have everything [...]

Read the full article →

Things to Look at When You Are Using a PhoneGap Plugin

December 5, 2011

PhoneGap is really cool since you can use web development technologies to do native mobile app development. Unfortunately it doesn’t support everything the phone does via its JavaScript API. For that you need to use plugins which execute native code, and is called from JavaScript. Makeup Of a Plugin PhoneGap plugins consist of 2 things. [...]

Read the full article →

HTML5, Webm, and Firefox – Why It Doesn’t Work Right Away

December 2, 2011

For GoDjango I like to use HTML5 video playback for all the screencasts, but unfortunately there isn’t a good standard video type for playback. Generally MP4 (h.264) works fine for mobile devices, chrome, safari, and IE. However, for Firefox, my browser of choice, you need to have either Webm or Ogg Vorbis. I ended up [...]

Read the full article →

Just Launched GoDjango

November 19, 2011

Recently I was compelled to learn python since it seemed like a lot of different forces were driving me to do so. After learning the syntax basics I figured I would take the next step to start learning Django since it is the predominant web framework for python, and I am a web developer. One [...]

Read the full article →