Pages

Skora Tempo Review



Picked up this shoe recently in a sale. The first thing that got to me hooked was the fact that even though it is a 0 drop shoe it still has about 22mm of cushioning which makes it a good bet to pound the pavement.

The shoe gives adequate protection while running and is surprisingly light. The upper is a mesh like structure through which you can almost see your socks or feet depending on how you like to run.

I would however say that unlike other skora models this shoe is not for running without socks. The toe box is more like the Altra running shoes which is good, However its just large enough to ensure that the outer edges of your feet (especially inside ball of the feet) rubs against the mesh. This ends up with giving you a nasty blister, especially when doing runs above 10km/6miles. I have also faced blisters on the heel but that seems to go off after a few runs. This can be circumvented by either using some tape or cutting out a little bit mesh where contact is made (I find cutting my shoes a better option).

Apple Watch


Some of the reasons why the Apple watch does not work for me in its current state.


  • Battery Life: This takes me back to the 1970s where the first thing you did, when you woke up, was wind your mechanical watch. Times have changed! You will be charging this daily.
  • Product Life: High quality watches last years. Apple will probably cover this watch for 2-3 yrs. The tech in it would get obsolete even earlier.
  • Standalone Device: It only works with an iPhone. On its own its useless, well its just a watch.
  • GPS: For at activity watch, at that price range, a built in GPS is needed. This needs your iPhone. Carrying an iPhone on a run (especially the bigger sized 6 and 6+) is a pain.
  • Water resistant: Not water proof, so no swimming or submerging it underwater for prolonged periods.
  • Productivity: Or Distraction? Seriously, is it that necessary to get an SMS or email notification on your watch?
So there will be the regular eager beavers who would line up to buy this watch. As for me, I will wait for the next iteration.

Database Indexes in Oracle

I have often been sucked into intense debates of database indexes and how they work.

In order to explain indexes in a simple way, think of a telephone diary that most of us use (or at-least used to some years back).  A typical telephone diary has tabs from A-Z and we save names along with other information based on the person's last name in the appropriate alphabet page.
For example William Gates would be listed under the G page or Steve Jobs would be under the J page.
The tabs therefore are indexes which enable you to quickly go to the relevant page and look up a name. If there were no tabs you would be forced to flip page by page and search for a name( which equates to a table scan).

Another example (though not directly appropriate) is the Facebook list that you maintain where in the regular suspects are Family, Friends, Acquaintances. However as you keep adding more friends there comes a need to further breakdown the Friends list to Close Friends, School Friends and University friends. This enables you to search for a friend in the appropriate list and locate a name faster than as opposed to looking up a single list called Friends. Of course the assumption here is that you don't use the search field to find a Name.

Database indexes work in a similar way. The more unique values the better the index performance. However in the database world retrieving data is not simple and there are different searches that one needs to perform on a table. Tradeoffs need to be made between performance while retrieving records vs saving/updating records and retrieval speed vs storage space.

Creating an index on a single column, a composite index on a multiple columns or multiple indexes on multiple columns often come up and become hot topics of debate.The debate further becomes skewed if the persons debating do not have proper understanding as to how indexes work.

The reason for choosing the Oracle database is simply because I use it. And while the basic principles of indexing remains the same across different database vendors, each vendor incorporates some quirks into their search logic. A prime example of this is the cost based optimizer introduced by Oracle (which some people also refer to as Voodoo magic).

So here's my understanding how database indexes work in Oracle.

Consider a table X which has columns a, b, c, d, e and f.
Say we index c,d,e,f. (Note: In a composite index the order of the composite columns also play an important role.)
The possible efficient queries are

1. select * from X where c = :c and d = :d and e= :e and f = :f
2. select a,b from X where c = :c and d = :d and e= :e and f = :f
3. select a,b from X where c = :c
4. select c,d,e from X where f =:f
(I have not listed all the possible queries but I hope common sense prevails)

In the above examples Oracle will use the composite index. Even in the 3 query oracle will use the index since c is the first column in the composite index

5. select a,d,e from X where e=:e
In such a case the index will not be used and even with a hint it will cause an inefficient retrieval of data.

6. select c,d,e,f from X where c=:c
In this case oracle will use the composite index as a skinny table and directly search and retrieve data purely using the index.

Lets take another set of indexes where say, there is one index on (e,f).
And then single indexes on a, b, c, d

The possible efficient queries are
1. select *  from X where e=:e and f =: f
2. select * from X where a=:a (and similarly for all index columns)

However consider the following:
3. select * from X where e=:e
Oracle will still used the composite index (e,f). Thus making the query efficient.

4. select * from X where a:=a and b:=b and c=:c
Oracle will either say let me do a full table scan or use the first index and then do a table scan to fulfill the other search. You could also use hints to tell oracle to use the indexes on a, b and c. This will still be in-efficient as opposed to having a composite index on all 3 columns (a,b,c).


So before you decide on your indexing strategy, you need to first define your queries for retrieving data and then make a decision.

Database multitenancy architecture

With a sizable number of companies offering SaaS software. Architects are faced with typical problems of how to manage their customer's data.
Questions like, Data security, backup, recovery, cost(ROI) are typically what an architect needs to answer when offering a strategy to achieve multitenancy.
Whenever my peers ask me "What is the best database strategy to achieve multitenancy".
My answer is "It depends!"
  • It depends on the domain that you are targeting. Or rather the data that your software is going to manage. The isolation that is required. 
  • It depends on the dollars your business is willing to spend (also read as licensing fees, hardware at your disposal, ability to quickly ramp up production capacity). 
  • It depends on how fast you need to provision or setup a new customer. 
And while I can go on and on, the point here is that there has to be "buy in" from your business that lets you decide what is the best strategy to be applied to the application that is being built.

As far as databases are concerned there is only a finite set of approaches that can be used to achieve multitenancy and these approaches would take you from a isolated to a shared database architecture. The reason I go from isolated to shared architecture is because in the past decade many software companies that offered "single installation" products have modified their offerings to make them "SaaS" compatible and as they try to manage cost they knowingly or unknowingly move from an isolated database to a shared database architecture.

Separate database
Each customer/ tenant has a separate database. This is probably the most easiest approach to mutitenancy. The customers data is isolated. There is no way another tenant can access or corrupt the data. In case of customization needs the data model can be extended as per your customers requirements. Backup and restoring is straight forward and there is no impact on the another tenants data. Almost zero or minimal application logic is required to achieve isolation. This however is a costly approach as you add more and more customers to your offering. Hardware and processing costs will be higher. A single server can only hold a finite number of databases and so more hardware will be required. And you would need a substantial budget and strategy as you start gearing up for horizontal scalability. This strategy is most suited for customers who are willing to pay a premium for added security and customization.

Shared database separate schema
This approach is similar to the separate database approach. It provides logical isolation of data. Each tenants data can be accessed using the schema name and the table name. There is some application logic required to resolve the schema for the entity. You can accommodate more customers per server as compared to the separate database approach. Data restoration would provide some problems when it comes to restoring a specific customer's data. This approach is suitable when you have a small number of tables that are used by your application.
(A variation to this model would be a shared database, shared schema and separate tables per tenant. Additional logic would be required so resolve which set of tables to use for a specific customer).
This approach while costly is still cheaper to implement as compared to the separate database approach. This strategy is suited for customers who accept co-location of their data.

Shared database shared schema (and shared tables) 
In this model the customers data is stored in same set of tables. A tenant id column is required in all relevant tables to identify a tenant's data. 
This strategy is the most cost efficient as far as your hardware budget is concerned. However there would be extensive application logic required to ensure security and separation of data. Added care from a software architecture perspective has to be taken so as to ensure that a tenant can NEVER see or corrupt another tenant's data.

Data restoration in case of a failure can be big pain point especially if you are trying to restore a specific tenant's data. This would involve importing your backup into a temporary database and then copying over the relevant tenants data into the production database. This could be a fairly complex (or as a friend of mine would say "Non Trivial") and time consuming task.

As far as performance is concerned, one customer's volume could potentially impact another customer.
As you keep adding customers you could potentially reach OLAP volumes requiring OLTP operations. Hence your indexing, partitioning, archival strategies play an important role. But more on this later..

Irrespective of the approach taken, it is important to understand the trade offs being made. It will also play an important role in deciding your strategy as far as scalability, extensibility configuration capabilities are concerned.




Apple vs Google

iCloud is coming and already everyone is talking about how great it will be. Fact of the matter is that there are literally thousands of vendors with cloud based solutions over the past 5 years.

Google, Salesforce, Amazon and to an extent even Microsoft have been providing cloud based solutions to their Customers.
But today I am going to speak about Google vs Apple and take up a non-technical key aspect when it comes to comparing the two. And that is the "message" that is given out to their Customers (both current and potential)

Apple went past Google to become the most valuable brand in the world and it has achieved this in a span of 5 years (since 2006 its brand has grown 859%).

Apple's message has been user centric. They focus on the simplicity and ease of use. Their message for iCloud was "It just works!" They did not focus on what server, what login, how one can save their data on the cloud. They have built it intrinsically into their apps and said that we as users dont need to worry about details. As geeks we may say that this is another way to tie you down to the Apple ecosystem but, normal users really dont care as far as the job is getting done.

Google on the other hand focuses on the technology aspect which overwhelms the average user. I have been using Google Apps for the past 3-4 yrs but people around me don't even know about it.  When I speak to people about it, the reaction I get is that of surprise. "Oh Google has documents and sheets like Microsoft office!" or "I didn't know I could use Gmail for my office". The minute one says "Google" people co-relate it to search. But the fact is that Google has been providing a much more advanced cloud based platform for everyday users for managing their productivity. However it seems that their message only gets through to geeks and not normal everyday users. 

Google has a clear advantage when it comes to their Cloud based offerings and the years that they have invested in it. However Apple has been more effective in marketing their message across.

iOS 5

The ball is back into Google's court as far as iOS vs Android wars are concerned.
Here are a few features that I wanted in iOS and are now available for use in iOS 5.

But let me start with one of the most eager features I thought the iPad or iPhone should have in my previous post 3 months ago which is now a reality.

Standalone Device: The iOS device can now be used as a standalone device. You can upgrade, download apps and backup (using iCloud) without requiring a PC or a MAC. Further you can optionally still back up with you computer over WiFi. This eliminates the need of connector.

iCloud: Cloud based synchronization to keep all your devices updated, with mail, contacts, photos, apps, messages and books (along with book marks) and last but not the least music. But more about this in another post

iMessage: The Apple Messages app simplified text messaging and grouped them as conversations similar to their iChat application on OSX. iMessage is now integrated into the Messages. This is Apple's answer to RIM's BBM. You can now text, send photos and videos. In addition to this you have group messaging and delivery receipts with optional read receipts. With over 200 million IOS devices one could argue that this is a blow to traditional SMS and MMS offerings. However SMS and apps like WhatsApp would still be good mediums for cross-devices messaging.

Reminders: Apple calls it a "better way to do to-dos" and I agree! Not only can you organize your tasks with due dates but you can now make them location based. So you could create tasks that you need to address as soon as you reach your work place and tasks that you need to do at the nearby grocery store. And an alert appears as soon as you reach your destination.

Notifications:  No more annoying popups. iOS5 comes with a Notification center which consolidates all notifications

Some other features include Multitasking gestures, Photo editing, airplay mirroring and much more. You can go to the Apple site to read more




iPad 2 and IOS 4.3

IPAD2

  • All new design
  • A5 Dual Core processor
  • 9 times faster graphics
  • Front and rear cameras
  • Gyroscope   
  • 33% Thinner (less that the iPhone4)
  • Lighter from 15 lbs to 1.3 lbs
  • Comes in 2 colors
  • Works with both AT&T and Verizon
  • Same "legendary" 10 hours batter life. (A month of standby)
  • Same pricing structure
  • Shipping March 11
 Accessories:
  •  HDMI Video out (runs 1080p) for 39$
  • Smart Covers (bendable flap that sticks on the side). Wakes iPad from sleep when you open it and puts it to sleep when you close it. Magnetic grasp to hold the unit
Applications coming to the iPad
  • iMovie: Features:
    -Prevision editor
    -multitrack audio recording
    -new themes
    -AirPlay to Apple TV
    -Share your videos in HD
    -Universal app
  • GarageBand!! Touch instruments
    Guitar amps and effects
    8 track recording and mixing
    More than 250 loops
    Email AAC file of your song
    Compatible with Mac version.
And the iPad 2 is now displayed on the apple site 
      IOS 4.3 (March 11, 2011). Supports iPad, iPhone (GSM) and iPod Touch (3rd and 4th generation)
      • Safari performance bump with the nitro javascript engine. Runs javascript twice as fast as before
      • iTunes Home sharing (See your other iTunes libraries from your PC and Mac on your iOS Device
      • Airplay improvements (Photo slide shows, Video and Audio from apps to other devices
      • Preference for iPad Switch (Mute or rotation lock)
      • Personal Wi-Fi hot spot
      • Photo Booth in IOS 4.3 with nine live video streams and various effects
      • Facetime on iPad
      Some pictures from the Apple Event going on right now!!