Network tiering

August 21, 2008

Tier 4:
- most datacenters
- owns internal network
- pay other networks for IP transit outside the facility

Tier 3:
- regional providers
- build redundancy thru’ redundant POPs (points of presence) outside facility
- pay for IP transit past the POPs

Tier 2:
- national or international footprint
- still pay IP transit to reach some portions of Internet

Tier 1:
- do not pay IP transit
- global presence
- don’t pay other providers for any portion of connectivity


Datacenter tiering

August 21, 2008

Tier 1:
- 99.671% uptime
- annual 28.8 hrs downtime
- full shutdown for preventive maintenance

Tier 2:
- 99.741% uptime
- annual downtime of 22 hrs
- some redundancy with single path for power, requiring shutdown for preventive maintenance

Tier 3:
- 99.982% uptime
- annual 1.6 hrs downtime
- sufficient redundancy to allow planned maintenance
- at least 13.2 KV power

Tier 4:
- 99.995% uptime
- annual downtime of 0.4 hrs
- multiple paths to power and AC and designed to handle worst case scenario with no critical impact
- at least 26.2 KV power


C++ coding tips

August 8, 2008

Some C++ coding tips:

- Do not turn off warning level(s) from compilation. This will save you trouble later. Use as much stricter settings as possible.

- Do not ignore warning(s) in your build process.

- Stick to ANSI C++ coding as much as possible.
All header file code must be contained within:

#ifndef __file_h
#define __file_h 1

… (code)

#endif
Use “#pragma once” as first line of header file if using Visual C++ compiler 2003 and later.

 - Do not use “goto” if possible.

- Always perform clean build before code submission and/or merge.

- Use “const” modifier as much as possible.

- Define “enum” with assigned values. Do not let it go for assumption. This improves readability. Say,

enum MyEnum {

SUNDAY = 0,

MONDAY = 1,

}; // enum for days

- Use brackets in pre-processor director. Say,

#define BIT(n)  (1 << n) // not preferred

#define BIT(n) (1 << (n)) // preferred

- Prefer library functions that take size or count argument over to functions without such argument for string manipulation. Say,

strncpy is preferred over strcpy.

- One include file should not contain more than one class definitions.

- Using “const” or “enum” is preferred over using “define” for contants. Say,

#define LOOP_COUNT  100 // non preferred

const int LOOP_COUNT = 100; // preferred

enum { LOOP_COUNT = 100, }; // or preferred

- A member function that does not modify class state must be declared as “const”.

- A class must have a default constructor with all data members initialized in it.

- A class must have copy constructor and assignment operator defined to avoid surprises.

- Assignment operator function must take care of destructive operation e.g. assigning to self (a = a).

- Avoid functions having more than five arguments.

- Do not mix malloc/free and new/delete.

- If array is allocated using “new”, use “delete []” for deallocating it.

- Avoid type conversions if possible.

- Re-initialize pointer when deallocated. Say,

delete p;

p = NULL;

- It is good to have a carriage return in the end of a code file.

- Use inclusive lower limit and exclusive upper limit in “for” loop. Say,

for ( int idx = 0; idx < MAX; ++idx ) // exclusive upper limit

for ( int idx = MAX; idx >= 1; –idx ) // inclusive lower limit

- Do not use “static” variable in “inline” function in header file.

I hope that this article is helpful and will avoid some silly bugs creeping over your code :-)