Everybody Likes Ninjas

SQL Azure

Monday, 25 January 2010 10:52 by Guy

Guy

Sql Azure is Microsoft’s solution for relational database cloud computing, it comes as part of Azure platform. As with the Azure platform in general, to implement such a solution many limitation were placed on the Azure version of SQL server. The implantation as technical solution is amazing and requires some IT background to figure the complexity of the solution.

The best place to start the explaining SQLAzure is with describing the infrastructure. As a user you are granted with a token, this token is used to create all your databases. First DB to set up is the Master DB, very similar the SQL Server Master DB(more on the functionality of the Master DB in the next post). All traffic to the SqlAzure “Server” is routed through a firewall that allows you to limit the accesses to specific sources using a well design web interface. Then the connection is rerouted to a gateway that diverts the connection to the current server hosting the online copy of your database. All SQL server instances that build the SQLAzure platform are installed on cluster machines to support high availability to improve availability the created database is automatically replicated across different machines . In the case of failure the gateway will automatically point to the current online database instance.

sqlazure

To increase scalability of your application and to maintain overall balances of the SQLAzure platform servers, your databases are placed across multiple servers. I.E. even though it looks like it, physically the your company databases are not placed on one server! What actually happens is that several companies share the same hardware! So how do you reach a specific database? The trick is in the login : the connection string must include the destination database, your connection undergoes authentication using the login setting saved in the Master DB and then diverted to the requested database that will probably be located on a different server.

Farther more to allow a fair resource distribution between the different databases and SQLAzure clients, several limitations are set on the databases settings and resource utilization. A detailed list of the limitation can be found in the following link, I bring the highlights:

  • The major change is that can’t manipulates local resources:
    • There is only one file group per database.

      The following technical resources are a good starting point to understand the SQLAzure platform :

    • No partitioning.
    • No fill factor.
    • No user define data types.
    • No full text indexes.
    • No memory settings or any other server level settings.
  • All tables must include a clustered index.
  • Each connection can only function in the boundaries of the database it is connected to.
    • No Trace or Profiler, due to the fact that when you connect to a specific DB you can interact with the Master DB .
    • Can’t use the USE <database> command.
    • Can’t use distributed transactions or queries.
    • Can’t use global temp tables.
    • No service broker
  • All logins are sql server logins, there is no domain support.
  • Maximum database size of 10G.
  • No SSIS or SSAS support
Connection throttling, to support fair resources distribution, is placed in the form of limitation on
  • Execution time limited to 5 min
  • Maximum open connection time
  • Limiting long running transactions and extensive resource usage CPU and memory.

These limitations will actively disconnect the client connection and STOP QUERY PROCESSING. Selecting the 10 GB (Business Edition) version over the 1 GB (Web Edition) version will grant your database with more resources and raise the limitation settings.

It is evident from the description above that SQLAzure is not a straight forward solution for high load OLTP databases or data warehouse implementation. Working tips scalability design considerations and more on the next blog.

Guy

Windows Azure

Sunday, 10 January 2010 09:38 by Guy

Guy

In the last 12 months, virtualization and cloud computing has become one of the hottest issues in the hosting world.It started with companies offering Linux based cloud services for Windows, based on cloud servers and then it expanded to new companies going into elastic computing, such as Rackspace and Opsource. Yet it seems that when it comes to MS-Sql server support and .Net, all current solutions fall short. The major part of the management work ‘falls’ on the user and the cost is far higher compared to Linux solutions. The user is supposed to install anything above the basic OS and to take care of upgrades, monitoring and duplicating resources (servers) on his/her own, for scale out solutions. Some of the solution providers sell their offering as a testing environment platform or as for simulating production environment, reducing client operation costs, compared to purchasing hardware and hosting fees.

Then, a few months ago, a new major player entered the world of cloud computing: Microsoft with WindowsAzure.  Microsoft will officially launch their services in January 2010 as a production hosting platform, and new web server farms will be operational all over the world during 2010. They have currently invited every ISV or Bizspark client to use the WindowsAzure environment as part of their CTP, allocating them with a limited CPU and instances Tokens. We have were able to upload a partial solution (covering 70%) of our application in less than a day’s work.

To solve the versatility of OS configurations and provide an almost instantaneous scale up option, Microsoft Azure takes a different approach than other elastic .Net supporting solutions. Mainly, WindowsAzure solution limits the application working environment physical resources usage and configuration. The most trivial example is that you can’t write to files, writing and saving of local data is done to special blob objects (which by the way can resemble small DBs). The server instances are virtual, and I don’t mean VM or Hiper-V.  The application is running on an AppFabric environment. The Fabric has the ability to run worker-roles that are very close to services and web roles that are very close to web services. The actual code has to be compiled, especially for the AppFabric environment (a very simple process), but anything that was developed in .Net could be converted to Azure.

 

WindowsAzure

The usage bonuses from running on WindowsAzure are mind blowing: 

  • Scale out is preformed by changing configuration settings, and deployment to multiple servers takes about 15 (officially one day max).
  • Every instance is automatically duplicated and set to standby mode, so if your instance crashes the copy is brought to life in a matter of seconds.
  • You can run different versions of your application test performance results, and increase or decrease the number of instances in minutes.
  • Pay just for what you use, when prices in comparison to owned and hosted server are very low.
  • Fully redundant Hardware solution.
  • You can place your farm near your client location.
  • Automatic upgrades process to latest versions.
  • Configured security system.

 

   
 
The following technical resources are a good starting point to understand the Azure platform :

- Official Azure Site

- Pricing

Videos from PDC

- Developer blog

 

Microsoft has even taken its solution one step forward, and offers the WindowsAzure platform for private cloud implementation. Your organization can install the Azure platform as a virtualization solution for internal environments solution such as QA and staging (just think what can be done when it comes to load testing), or as part of your organization SaaS solution, providing a private application environment for different clients, installed on the same hardware.

What Azure is offering for SQL cloud solution- on my next post.

Coming soon …

 

To cloud or not to cloud

Sunday, 10 January 2010 09:02 by Guy

Guy I love looking at the sky and staring at the clouds, your imagination can run wild and you can invent wonderful stories about the shapes you see in the clouds, but they always seem so far away out of your reach. For me, especially as a DBA, it was same with cloud computing.

Cloud computing has been around for a long time, starting with on Google Apps and Amazon AWS. Working in medium size companies has limited my exposure to them. About a year ago I was asked to join a panel discussing “IT for startups”, when one of the most interesting issues raised was ‘should we use the cloud hosting solution?’ My answer then was no. Along the last year my view about cloud computing has shifted to favoring cloud computing as a partial solution for startups.

 

What are the benefits of cloud computing?


1) Scaling up and down is possible within a matter of hours. Moreover, you only pay for what use, and on an hourly basis. Meaning, if a new client comes along, you can place a request for ten new servers, and within the next day or hour you’ve receives them fully load-balanced and ready to go.
2) All hardware and OS management are the provider’s responsibility. No need for highly qualified IT tech that has wide knowledge in networking, security, virtualizations, storage, and FW.
3) You receive fully monitored OS and hardware services, including reporting and alerts.
4) You receive a fully redundant solution with an obligation for high availability.
5) Worldwide location distribution brings the application closer to your clients.
6) No need to upgrade your hardware every three years.

What are the problems with cloud computing?


1) These are not your servers! Your control on selected OS versions, maintenance and patches is limited.
2) These are not your servers! Placing sensitive data from passwords to your core technology is an issue.
3) These are not your server! If it crashes, nobody promises you how hard they will try to save the data stored on the hard drives.
4) These are not your server! For some reason, I can’t see a cloud solution passing a credit card organization inspection…
5) These are not your servers! You will probably have to make changes to your application to fit cloud computing, due to limitation of installed environment.
6) Windows .net based applications are not native to this environment. If you want to enjoy the monitoring and management benefits, you will have to use a non .net language.
7) Database solutions are very limited either in capacity and version or in manageability.

Deciding if to use cloud computing or not is not an easy decision. It will affect your application design and development environment. I can help with some point for consideration:

CDN on cloud?

Downloads require a lot of bandwidth. Your organization will probably want a redundant network (which cost a lot of money), and there is always an issue of being close to your clients (which require multiple locations). In order to solve these issues, you’re probably using some kind of a CDN solution. If you’re total download is not in Terabytes, I recommend looking into a cloud solution such as Amazon S3. In S3 payment is per usage that alone makes a huge difference (I’m talking about thousands of dollars per year) over buying a minimal quota package per month from major CDN providers.

Cloud computing?

If you are a new upcoming company, requiring just a few dedicates server including load balancing and firewall services , a managed dedicated solution will cost you 1,000-1,500$ per month per server. Each cloud server is about 200-500$ and you only pay for what you use on hourly basis. The key benefit is the ability to scale up in a matter of hour and not weeks or days. And it’s important to place your server close to your client, the latency is amazing a minimum of 1-2 second latency from US and some parts of Europe and far east to reach servers in IL.

Database?

If you require a simple DB services with storage requirements lower then 10G, and the number of hits on your server per second is not in lower thousands, finding an adequate SQL or MySql solution should not be a problem. Your solution will enjoy high availability redundancy and will be located near your clients. I’m fooling around with the lasts solution for cloud databases SQL Azure, actually it is the trigger for writing this blog but that will be on my next post. For now, I’m going to stare at the sky and look at the far away clouds.

Embeding an Ad tag into a Flash component

Wednesday, 6 January 2010 10:04 by Ziv

Ziv How easy is it to embed Ads into a flash player?

If you have looked at our demo sites or our widgets site from a developer point of view, you have probably noticed that the Ads seem to be integrated as a part of the Flash layer.

It looks obvious, just call the ad jpeg or flash file and place them in the correct location. right? Correct , but...
And here comes a big BUT. The ad URL is not something given to you on a golden plate.

Big Advertisement companies and AdNetwors don't think about the possibility that some strange programmer would like to retrieve the ad URL from their server using client side code embedded in flash.

Their systems are built to support calls for ads URLs using iFrame URL or a JavaScript code.

Try and get the Ad URL from an iFrame URL while in flash. You just can't, since it's in a different domain the browser security infrastructure prevents you from reading the HTML DOM of an object residing in a different domain.

So you like to know how we did it?
You can’t .It's confidential. Believe me I like to say more (and I did post it until our panic team read about it and i had to remove the paragraph about our solution) I promise that once I'm able to disclose how it all works I will.

In the meantime if you are a JavaScript freak and like to talk more about the different format of JavaScript code the advertisers use on their systems place a comment or send me an email.