FPGA: Much ado about something

There is much talk about FPGA though it has been around for over two decades. Now discussion is focused on databases. A few companies came up with a solution based on inexpensive flash memory alternative. This is probably based on research done by this team. Flash based memory is extremely fast for read only searches, updates take significant time. There is a different way appliance is used in which data is streamed directly through FPGA to disks, by passing host CPU.

Some interesting points (also check previous posting below):

  1. Reduced latency compared to CPU or other general processors. This is due to the reason that FPGA does not contain number of layers a commercial CPU uses. For instance, FPGA on an interface card to a direct attached disk drive has lot less number of hoops to go through compared to a CPU getting access to same data.
  2. Virtualization with FPGA possible. CPU can execute one instruction at a time in a pipeline manner. FPGA can process in parallel a large number of instructions, here is a simple explanation on youtube.

FPGA hardware can be played around for prices as low as a few hundred dollars. However, FPGA programming kits are expensive and cost close to $100K. Here is a simple overview of Netezza architecture with FPGA as the main driver (source: Netezza).

FPGA in Netezza (Source: Netezza Doc)

Netezza Architecture (source: Netezza).

Netezza Architecture (based on FAST), source: Netezza

New trend in data appliances

We all have heard about column based data appliances and other variations. One particular architecture advance that is promising is “FAWN: A Fast Array of Wimpy Nodes”.

Noteworthy points from this development are:

  • Use flash memory for faster read access compared to disk, yet economical. For write, disk and flash memory is about the same. Flash prices have come down dramatically.
  • Power consumption is a very important factor to considerOld (or older) CPUs have better performance for same power consumption (Xeon versus XScale).
  • Implementation is much cheaper than Netezza.

This architecture is suited for write a few, read many times, like most DW databases. This FAWN is designed for a large data access based on a key, not really a database system as such. This qualifies as a ‘data appliance’.

http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA490226&Location=U2&doc=GetTRDoc.pdf

Netezza Questions and Answers

Explain FPGA and how is it useful for query performance.

FPGA: Field Programmable Gate Array (FPGA) is located on each SPU. Netezza is different from other architectures. Netezza can do a “hardware upgrade” through software by using FPGA. Hardware is reconfigured during install.

While reading data from disk, FPGA on each SPU also helps in ‘filtering’ unnecessary data before getting loaded into memory on each SPU. This way, FPGA does not overwhelm with all the data from disk.

What is a zone map.

Zone map in Netezza is similar (concept wise) to partitions in Oracle. Netezza maintains map for data so that it does relies on zone map to pull only the range it is interested in. For example, if we need to pull out data from Jan 2009 till June 2009 from a table that is distributed on date column, zone map helps us to achieve this. Zone map is maintained by Netezza automagically, no user intervention needed. Zone mapping is done at a block (extent) level. Netezza has zone maps for all columns (not just distributed column) and includes information such as minimum, maximum, total number of records.

How do you deal with historical data, with respect to zone maps.

Sort data first, based on historical data (for example, date) and load this in using nzload.

What are different ways to load

  1. nzload
  2. External tables
  3. Create table AS (aka, CTAS).
  4. Inserts (Eeeewee!!)

Does everything gets cached in Netezza (or any other data appliance).

Typically only schema and other database objects are cached in appliances. Data is not cached, in general. In most cases, data is not saved any where (in any cache or on host computer) and is streamed directly from SPU to client software.

What is the best data appliance.

Obviously, it all depends. This is my (limited) view:

  1. From features respect, Green Plum.
  2. Popularity with a bit of hype, Netezza.
  3. Matured and well respected, Teradata.
  4. With existing database integration, Dataupia.
    Largest implementations:

* Teradata: 72 nodes (two quad-core CPUs, 32GB RAM,104 / 300GB disks per node) and manages 2.4PB.
* Greenplum: Fox Interactive Media using a 40-node, Sun X4500 with two dual-core CPUs, 48 / 500GB disks, and 16 GB RAM (1PB total disk space)
Source: Vertica’s Michael Stonebraker!

How is load achieved in Netezza and why is that quick / fast.

Loads by pass a few steps that typically a query would go through (a query goes through plan generation, optimization and transaction management). Loads are done in terms of “sets” and this set is based on underlying table structure (thus loads for two different tables are different as their sets are based on table structures). Data is processed to check format and distribution of records calculated very quickly (in one step), fills into ‘set’ structure and writes to storage structure. Storage also performs space availability and other admin tasks, all these operations go pretty quick (think of them as UNIX named pipes that streams data and SPU stores these records).

When are we likely to receive incorrect (aggregate) results.

Very rarely a driver may return aggregated results that are still getting processed back to client. In this case, client may assume that calculation is complete, instead of updating with latest or final results. Obviously, driver has to wait for Netezza to complete operation on host computer, before delivering results.

Explain how data gets stored in Netezza and how does SPU failover take place.

Data is stored based on a selected field(s) which are used for distibution.

==Data (A)==> Hash Function (B) ==> Logical SPU identifier list (C) ==> Physical SPU list (D) ==> Storage (E)

When data arrives, it is hased based on field(s) and a hash function (B) is used for this purpose. For example, for a hypothetical 32 node system system, logical SPU identifier list has 32 unique entries. If there are 1000 hashed data items from (B), there are 1000 entries in (C), all having only 32 SPU entries (a number of data items go to the same SPU, thus multiple (B) entries map to same (C)). For instance, (C) has values [3,19,30,7,20,25,11,3,22,19....]. This way, 1000 data entries are mapped. (D) has physical IP address of both primary and failover SPU. If there is a failover, this is the only place where Netezza need to update its entries. Same goes for a system that has a new SPU added. It is a little complicated, in principle, this is the concept.

what are 4 environment variables that are required. What are different states on Netezza.
Environment variables: NZ_HOST, NZ_DATABASE, NZ_USER and NZ_PASSWORD
* Online: Normal or usual state.
* Stopped: Netezza will shutdown after completing current queries, no new queries allowed.
* Offline: Waits for completion of current queries, new or queries in queue receive error.
* Paused: Same as above, but no error displayed. Typically caused during Netezza bootup or startup.
* Down: Just plain down, could be due to Netezza server problem or user initiated.

Does Netezza support concurrent update of the same record
In case of conflict in which the same record is set for modification, Netezza rolls back recent transaction that is attempted on the same record, in fact same table. This is generally acceptable in DW environments. Netezza does support serialization transactions and does not permit dirty reads.
 
How Netezza updates records. Give an idea of how transactions are maintained and how read consistency is maintaned.
Netezza does not update records in place, it marks records with delete flag. In fact, each record contains two slots, one for create xid another for delete xid. Delete xid allows us to mark a record with current transaction for deletion, up to 31 transactions are allowed in Netezza for all tables. As noted earlier, only one update at a time allowed on the same table though. Here update refers to transactions that are not committed yet. Coming back to delete xid, this is how Netezza maintains transaction roll back and recovery. Once a record is modified, it’s delete xid is given transaction id; this is changed from previous value of 0, all records when loaded will contain 0 for delete xid. Note that FPGA uses its intelligence to scan data before delivering them to host or applications.
Sample data:
[ROW id][Create xid][Delete xid]
[R1][T1][0]
                           // First time a record is loaded, record R1
                                                  // After some time, updating the same record
[R1][T1][T33]                      // Record R1 is updated; note T33
[R33][T33][0]                     // New update record R33; similar to a new record this has zero for Delete Xid

If the record is deleted, simply deletion xid will contain that transaction id.
* Based on the above, how do you know a record is the latest. It has zero in delete xid flag.
* Extending same logic, how do we know a record is deleted. It has non zero value in delete xid flag.
* How do you roll back to transaction. Follow similar to above listing, we can roll back a transaction of our interest.
Note that transaction id is located in create xid flag and that is our point of interest in this case. From what I know, row id and create id is never modified by Netezza.
 
What happens to records that are loaded during nzload process, but were not committed.
They are logically deleted and administrator can run nzreclaim, we may also truncate table.

Can a group become a member of another group in Netezza user administration. Can we use same group name for databases.
In Netezza, public group is created automatically and every one is a memeber of this group by default. We can create as many groups and any user can be member of any group(s). Group can not be a member of another group. Group names, user names and database names are unique. That is, we can not have a database called sales and a group also called sales.

How can we give a global permission to user joe so that he can create table in any database.
Login into system database and give that permission to user by saying “grant create table to joe;”

What permission will you give to connect to a database.
List.  Grant list, select on table to public (if logged into sales database, this allows all users to query tables in sales database).

Do we need to drop all tables and objects in that database, before dropping a database.
No, drop database will take care of it.

What constraints on a table are enforced.
Not null and default. Netezza does not apply PK and FK.

Why NOT NULL specification is better in Netezza.
Specifying not null results in better performance as NULL values are tracked at rowheader level. Having NULL values results in storing references to NULL values in header. If all columns are NOT NULL, then there is no record header.

Create Table AS (CTAS), does it distribute data randomly or based on table on which it received data.
Response: Newly created table from CTAS gets distribution from the original table.

Why do you prefer truncate instead of drop table command.
Just empties data from table, keeping table structure and permission intact.
 
When no distribution clause is used while creating a table, what distribution is used by Netezza.
First column (same as in Teradata).

Can we update all columns in a Netezza table.
No, the column that is used in distribution clause cannot be used for updates. Remember, up to four columns can be used for distribution of data on SPU. From practical sense, updating distribution columns result in redistribution of data; the single most performance hit when large table is involved. This restriction makes sense.

What is dataslice and SPU.
For me, they are the same! Of course, this answer is not accurate reply in your interview(s).

What data type works best for zone maps.
Zone maps work best for integer data types.

What feature in Netezza you do not like.

Of course, a large list, especially when compared to Oracle. PK and FK enforcement is a big drawback though this is typically enforced at ETL or ELT process [ELT: Extract, Transform and Load. Note that 'Transform' and 'Load' can happen within Netezza].

Netezza and Datallegro (and other data appliances)

[As you guessed, these are purely personal thoughts, not all of them may be valid]
Netezza had a head start and proved lots of success in getting industry acceptance. In fact, it has created such a reputation, it comes to mind whenever any one talks about data appliance. Oracle’s Ellison considers data appliance and Netezza as synonymous! Netezza truly created a great market that never existed. Netezza promised to its customers far less and conservative numbers in performance and when customers did a POC (proof of concept) it blew them away.
On the other hand, Datallegro is still struggling to get a foothold. It appears that Datallegro products are still going through rough grow up period. However, Datallegro product is much cheaper and performs about the same level as Netezza. Netezza is based on postgres whereas Datallegro is based on Ingres (Postgres evolved from Ingres). I do not understand how Datallegro could make a claim that their product is better because it is “not” based on proprietary technology?!! Though Datallegro uses industry standard products (Dell, EMC, Cisco, etc), it has significant proprietary code as one would expect.

Netezza (NZ) Architecture: Netezza is based on distributed multi-processing. Each SPU is a self containing (kind of) computer with its own OS (dbos), CPU, memory, etc. All SPUs communicate with master host and they do wonderful job in queries, data loads, etc. Netezza upgrades are ‘walk in the park’ and can be performed by relatively inexperienced personnel. Their technical support is truly amazing. However, Netezza is pretty under developed in its backup strategies. It is “more” proprietary technology compared to Datallegro (or possibly any other appliances).

Datallegro (DA) architecture: Similar to Netezza, except master node runs Ingres, as well as all other slaves. You can really see what is going on with DA by querying master database and slave databases. DA puts a glue through QD server (think of it as an application server) between master and slave databases. Both master and slave databases run on its own host, and you can see all components while working (unlike Netezza, which gives limited visibility on slaves). All queries are interpreted (NZ quries are compiled into C++ code. Interpreted code is very slow compared to compiled code) through DA’s proprietary code before getting pushed to slaves. Obviously, DA supports small subset of Ingres. It is generally believed Ingres is far superior compared to (more successful cousin) Postgres.

Now there are plenty of players in data appliance market
* Netezza
* Datallegro (now acquired by Microsoft. There are rumors that Microsoft paid between 100 and 300 millions).
* Vertica (with HP support)
* Green Plum (with SUN support)
* Sybase just announced one (July first week 2008)
* Dataupia
* Kognito
* Teradata (?)
* ParAccel
* InfoBright
* Oracle DW Appliance (with HP)
* NeoView from HP (based on Tandem database)
* IBM product (not sure how it fits in)
* At least one more (HP is contemplating on extending its Compaq / HP Tandem DB technology).

I feel that Microsoft and Datallegro deal is difficult to make it work. DA technology is so far away from Microsoft platform, I wonder if any data appliance would emerge at all out of this. Frankly, there will be so much competition within a couple of years from other vendors, Microsoft may not see it as a viable market.

Follow

Get every new post delivered to your Inbox.