Skip to main content

Gentlest introduction : Databases

Why database

I know a quick google on the definition of database will yield results suck as a repository of information  but what my tutor taught me is that that definition is akin to defining an engine as a collection of metal parts. So the definition must now be more inclined towards why database.

Because database is more than just storing information (because whats the point when you can simply store the information on an excel spreadsheet. Why database then? Its because of what happens next.

Imagine these scenarios (which are perfectly normal when it comes to real world scenarios)

Data

  • Grows
  • Changes over time - and we need to be able to track the changes
  • Should be fast and searchable
  • Should have awesome up-time and be interdependent to other systems
  • should be consistent and protected (secure)
So why database is to be able to solve all the problems that come with data. It is to provide a more organized repository of information. 


Relational Database management Systems Concepts

  1. Entity - its a thing/object
  2. Tables and Columns - generally a table for each entity
  3. Keys - Can be Primary and Foreign
  4. Referential Integrity - Keys must address that!
  5. Schema 
  6. CRUD - Create, Read Update Delete operations
  7. Transactions 
  8. ACID: Atomic (cannot be split) Consistent (Valid then, Valid now) Isolated (Before a transaction is complete changes are not reflected) Durable (When a change is made. It is made)
RDBMS was a pretty cool concept and has been reliable for a very long time but one of the key disadvantages now is that it is not flexible enough for a fast changing world. So what has happened now?

a) Non Relational Database Management Systems (aka No SQL)

This is a more dynamic approach with the added benefits of speed, scaling and cost. For example MongoDB 

b) NewSQL

This is a blen of the old and the new (RDBMS and NRDBMS) bringing Polygot Persistence





Comments

Popular posts from this blog

Gentlest introduction : The Cloud

How it began To me the concept of cloud started when people began virtualizing their systems using the like of Virtual-box and VMware. What bough this a;long was the evolution/advent of technology which made it possible for software so simulate hardware. Originally software could not simulate hardware drivers but the moment that became possible- virtualization was born. A few years after- companies started offering this virtualization at a much grander scale and Infrastructure as a service was born. Lets get down to the three cloud components namely: Infrastructure as a Service (IAAS) This outsourced hardware meaning that one noways noes not need to setup servers, air-con and the like of access control but could 'rent' from someone and one of the great things about this was that a backup not only meant software but also meant hardware (as software could now simulate hardware) so recovery in case of disaster became easier. Platform as a Service (PAAS) This is ...

Deploy Django app online for free!

So after a number of lines of code, brilliance and dreaming. Your next dream is for the world to see. Of course you can walk around with your computer and doing a 'manage.py runserver' But cumon guys, lets embrace the cloud. Not like this guy though! I choose to deploy on  PythonAnywhere . So you ask why? 1) Free amazing support - You actually talk to a live human ! 2) Easy - Very easy 3) Affordable - As you scale up, it gets way better! So by now I assume you are already on a version control system (So I will not waste much energy on that one). Maybe Ill someday write on my two favs  Github  and  Bitbucket . STEP 1: Create an account on pythonanywhere. Kindly note that your username will be included in your apps url. So it will be like : " yourUsername .pythonanywhere.com" STEP 2: Select other and set a bash console. STEP 3: Push your code from version control This will push from (in my example) github to your pythonanywhere. You...

PRG, PRF, PRP in Cryptography - What are they?

So I have been reading up on my cryptography and I figured I should give out a brief lesson on these three amazing concepts What are they ? a) PRG (Pseudo Random Generator) You probably know the difference between stream and block cipher. One of the main differences between them is key size. Stream ciphers require the key to be of equal length of greater than the plaintext ,   whereas Block Ciphers take a key smaller than the PT and is then expanded. This is the PRG The PRG expands the seed Considerations: Stream Ciphers base on Perfect Secrecy whereas Block Ciphers base on Semantic Security b) PRF (Pseudo Random Function) Lets share a secret- imagine something- you want to authenticate yourself with me by proving that you know a secret that we both share. Here's a possible option i) Possible Option 1:  PRNGs We both seed a PRNG with the shared secret, I pick and then send you some random number i.  You   then have to prove that you know the s...