CEE MVP Open Days 2015

The event was held on Sunday and Monday: 29 – 30 of March of March 2015 in Belgrade . Serbia. Each year the Microsoft MVPs from each region meet at special “MVP Open Days” event, meeting also professionals from Microsoft Product teams. This was f the biggest Microsoft MVP Open Days for the Central Eastern Europe Region. MVPs met also specialist from the Microsoft Development Lab in Serbia.

Many special thanks to Alessandro Teglia ( EMEA Regional Manager for the MVP Award Program @Microsoft )  , Yulia Belyanina ( Community Program Manager, CEE @Microsoft) and Marina Terzi ( MVP coordinator @ Microsoft ) who did a lot this event to be organized.

This was my first event as a speakers after I joined Strypes / ICT Automatisering . I’m glad that my sessions about modern IoT solutions with Microsoft Azure was included in the schedule. That gave me opportunity to share some impressions about solutions architecture and best practices regarding to the experience gain in Strypes and ICT Automasering .

You can enjoy some photos from the event below:

11096571_10206343973868919_8300165194104039360_n[1]

11081368_10206345080576586_39145765400419315_n[1]

11103021_781087831959602_7602724336484114163_n[1]

11082555_10206344808929795_4758352264124318729_n[1]

11081073_781087955292923_2363353690240429989_n[1]

10665200_10204931179692789_3024002307507526831_n[1]

Event Recap:

– It was the MVP Open Days event with most ever MVPs – participants from CEE

– There was 3 sessions from MVPs from Bulgaria

– My session on “Think Connected – Modern IoT Solutions with Microsoft Azure” was included in the track with technical presentations

You can learn more about the community events in CEE if you follow me on Twitter @mihailmateev , and stay in touch on Facebook, Google+, LinkedIn and Bulgarian BI and .Net User Group !

pass_logo_partner_bw[1] Strypes-LOGO+payoff_FC

Posted in .Net, Azure, Azure NoSQL, Azure Storage, ceeod, COD15, ICT, ict.eu, Internet of Things, IoT, Microsoft, Microsoft Azure, Microsoft cloud, MVP, MVPBuzz, Strypes, Strypes.eu | Leave a comment

Get each eBook and Video prom Packt Publishing only for 5$

 

If you like eBooks and videos, provided from Pack Publishing you have chance to buy each of them only for 5$. You can do this until 6th of January. Consider this attractive offer – especially if you want to read and watch about the latest technologies for app development and future trentds

clip_image002

Following the success of last year’s festive offer, Packt Publishing will be celebrating the holiday season with an even bigger $5 offer.  

From Thursday 18th December, every eBook and video will be available on the publisher’s website for just $5. Customers are invited to purchase as many as they like before the offer ends on Tuesday January 6th, making it the perfect opportunity to try something new or to take your skills to the next level as 2015 begins.

With all $5 products available in a range of formats and DRM-free, customers will find great value content delivered exactly how they want it across Packt’s website this Xmas and New Year.

Find out more at – http://bit.ly/1wlsbea

Posted in Android, eBonanza, eBooks, iOS, JavaScript, jQuery, JS, mobile, Packt, Packt Publishing, Packtpub, SQL, SQL Server | Leave a comment

SQLSaturday #356 Slovenia 2014–Event Recap

 

sqlsat356_web2The event was held on Saturday, 13th of December 2014 in Faculty of Computer and Information Science, Ljubljana, Slovenia.   It was one of the most attractive conferences about Microsoft data platform in the region

I was very glad to speak at this event as an independent speaker. My session was about

Entity Framework 6.1 new Features and EF 7 Sneak Peak. Slides are available on the SQLSaturday #356 Slovenia website .

This was the second SQLSaturday in Slovenia.

Administrators of the conference: Dejan Sarka , Mlaqden Prajdic and  Matja Lan demonstrated an awesome organization, that is one of the best examples how one event could be organized. They build a very strong team, that arranged everything in the best way. The registrations drop off was less than 5%.

The #sqlsat356 conference venue: Faculty of Computer and Information Science in Ljubljana

Denny Cherry – @MrDenny is talking about indexes in SQL Server

#sqlsat356 lunch break

Milos Radivojevic in action:

SQLSaturday Slovenia raffle and closing

Event statistics:

  • more than 220 attendees on place
  • 4 tracks
  • 24 technical sessions
  • Speakers and attendees from 16 countries

If you want more information about the event and PASS community feel free to contact me at michael@mateev.net Follow this event on Twitter with hash tag  #SQLSatSlovenia.

You can learn more about the PASS events if you follow me on Twitter @mihailmateev  , and stay in touch on Facebook, Google+, LinkedIn and Bulgarian BI and .Net User Group !

 

Posted in BI, BI & .Net Geeks, BI & .Net UG, BI & .NET User Group, EF, EF 6, EF 7, Entity Famework 6.1, Entity Framework 6, Entity Framework 7, Entity Framewrok, ORM, PASS, SQL, SQL Saturday, SQL Server, SQL Server 2012, sqlfamily, sqlpass, sqlsat356, sqlsatslovenia, SQLSaturday, SQLServer, SQLServer 2014 | Leave a comment

SQLSaturday #359 Ustanbul 2014 – Event Recap

 

SQLSAT359_SPEAKINGThe event was held on Saturday, 6th of December 2014 in Microsoft – Bellevue Residences.   It was one of the biggest Microsoft data platform related events in the region

I was very glad to speak at this event as an independent speaker. My session was about

Scaling Out Microsoft Azure SQL Databases Slides are also available for download.

There was an additional event: PreConf , one-day training about SQL Server Query Tuning & Optimization hold by Benjamin Nevarez  on Friday 5-th of December.

This was the fourth SQLSaturday in Istanbul. Administrators of the conference were Yigit Aktan and Turgay Sahtiyan

They organized a team of volunteers who did an awesome event.

0045398f-ccf3-486c-8bda-fbc9751429a5 sqlsat359-1

sqlsat359-3 sqlsat359-4

Event in numbers:

  • more than 250 attendees on place
  • 5 tracks
  • 25 technical sessions

If you want more information about the event and PASS community feel free to contact me at michael@mateev.net Follow this event on Twitter with hash tag  #sqlsatIstanbul.

You can learn more about the PASS events if you follow me on Twitter @mihailmateev  , and stay in touch on Facebook, Google+, LinkedIn and Bulgarian BI and .Net User Group !

Posted in Azure DB Elastic Scale, Azure SQL Datbase Scale Out, Microsoft, Microsoft Azure, Microsoft cloud, Mihail Mateev, PASS, Scale-Out, SQL, SQL Saturday, SQL Server, SQL Server 2012, sqlfamily, sqlpass, sqlsat359, sqlsatistanbul, SQLServer, SQLServer 2014 | Leave a comment

JSNext Bulgaria 2014–Event Recap

On November 23 was held the first event focused on the cutting edge JavaScript technologies – JSNext Bulgaria 2014. JSnext  is the largest conference in Bulgaria for JavaScript technologies.

What is JSNext Bulgaria

  • The very first conference in Bulgaria dedicated to the cutting edge JavaScript and related JS frameworks
  • An event organized with the support of Infragistics, jQuery Sofia UG, Infragistics Friends ( BI & .Net) UG and many volunteers
  • Thanks to the sponsors who helped cover the expenses!
  • An one day event with sessions dedicated to all that is JavaScript.
  • It is a chance for the local community to immerse in their favorite web technologies
  • The largest event for WEB developers in Bulgaria for 2014
  • JSNext Bulgaria inherits jQuery Bulgaria event

 

Why  JSNext Bulgaria

  • JavaScript is not jQuery any more
  • JSNext (aka JS version next ) Bulgaria is an event about cutting edge JS-related technologies

 

Event history:

After the few successful “Saturday” format events across different platforms and jQuery Bulgaria conference, the JavaScript event received major interest.

JSNext inherits jQuery Bulgaria conference, but JSNext Bulgaira is a new kind of event :
mainly targeting the latest and the future JavaScript technologies

Infragistics confirmed its support for the event: Thanks to Jason Beres: VP of Development Tools,  Product Management, Community and Evangelism @ Infragistics
Thanks to all community leaders who also confirmed their support!

We chose Sofia Event Center as the best location for this event.

All our speakers are also volunteers – they decided to cover their own expenses to be possible to avoid charging community members

 

 

 

 

 

 

 

 

 

 

Infragistics participation in the event:

Infragistics was the main sponsor and organizer of the event.

There was one keynote session and one technical presentation from Infragistics Inc.:

 

Some statistic

  • Nearly 750 registrations
  • More than 600 attendees on site
  • First event in Bulgaria, dedicated to the cutting edge JavaScript related technologies. 
  • The biggest event for WEB developers in Bulgaria this year
  • A Free event for student, academics and community leads
  • 22 sessions in 4 tracks
  • Attendees from 6 countries (Ukraine, Poland, Macedonia, Serbia , Romania and Bulgaria)
  • 25 Speakers from 4 countries (Ukraine, Poland, Macedonia and Bulgaria )

Pictures from the event:

Some photos are available here .

Follow @jsnextconf event on Twitter with hash tag   and get news on all our events with #jsnext and #jsnextconf.  Additional information can be found at the conference website – www.jsnext.net

As always, you can follow us on Twitter @mihailmateev and @Infragistics and stay in touch onFacebook,Google+andLinkedIn!

 

Warm Regards,
Team JSNext Bulgaria

Posted in .Net, Angular, Angular.js, AngularJS, ASP, ASP.Net MVC, Azure Web Sites, IG, Ignite UI, IgniteUI, Infragistics, Infragistics Bulgaria, Infragistics Friends, Infragistics Inc., jQuery, jQuery Sofia, JS, JSNext, JSNext 2014, JSNext Bulgaria, Knockout, Knockout.js, KnockoutJS, Node, Node.js, Node.js and Azure, NodeJS, Polymer, React.js, Three.js, TypeScript, UX | Leave a comment

SQLSaturday #311 Bulgaria 2014–Event Recap and Follow-up

After the successful SQLSaturday # 152 and SQLSaturday # 199 for the third time in Bulgaria SQLSaturday was held for the third on 11 of October, 2014. It was the biggest SQLSaturday organized in Bulgaria and the region around. This event is organized from PASS with the major support of Infragistics, Infragistics Friends User Group ( BI & .Net Geeks) and many partners, sponsors and volunteers.

 

What is SQL Saturday:

Infragistics as a company that develops solutions for data visualization and business solutions has many common points in with areas covered from the  conference: BI, Reporting, SQL Server related solutions

 

Our statistics:

  • 400 registrations + 91 people in the wait list.
  • around 250 real attendees from 16 countries (USA, UK, Portugal, Poland, Holland, Belgium, Turkey, Ukraine, Russia, Bulgaria and Serbia).
  • Speakers and attendees from 16 countries
  • 27 speakers from 15 different countries( Austria, Germany, UK, Denmark, Nederland, Portugal,  Poland, Hungary, Romania, Slovenia, Macedonia, Russia, Ukraine, Turkey and Bulgaria )
  • 16 Microsoft MVPs
  • 3 Microsoft MCMs
  • 30 sessions in 5 tracks
  • Attendees from 5 countries ( Serbia, Macedonia, Romania, Ukraine and Bulgaria )
  • The biggest event on Microsoft Data Platform ever organized in the region

 

Some pictures from this event:

Dejan Sarka is talking about Optimizing Temporal Queries

 

Magi Naumova is presenting

 

Lunch break:

 

Milos Radivojevic (  @MilosSQL ) in action:

 

Some of the speakers:

 

The SQLSaturday #311 Bulgaria raffle

 

Some of the raffle winners:

 

You can see more pictures from the conference here:

Feedback in Twitter about SQLSaturday #311 Bulgaria

 

 

Infragistics participation in the event:

  • Infragistics was SQLSaturday Bulgaria  conference host , main supporter and a  gold sponsor.
  • Administrators at the conference were Jason Beres and Mihail Mateev
  • There was more than 15 volunteers from Infragistics Bulgaria who helped  the conference to be held
  • There was 1 technical presentation from Infragistics:
    Node.js for SQLServer Nerds : Mihail Mateev

The conference schedule is available here:

Now SQLSaturday Bulgaria Team is looking for appropriate dates for SQLSaturday Bulgaria 2015.

More information about SQLSaturday Bulgaria is available  on the website of the conference http://www.sqlsaturday.com/311/  ,  SQL Saturday Bulgaria Facebook page and you can follow #sqlsatBulgaria and #sqlsat311  on Twitter.

Follow news from Infragistics for more information about new Infragistics events.

As always, you can follow us on Twitter @mihailmateev and @Infragistics and stay in touch on Facebook, Google+andLinkedIn!

Warm Regards,
SQLSaturday Bulgaria Team

 sqlsat311 Saturday

Posted in Azure Blob Storage, Azure NoSQL, Azure Storage, Azure Table Storage, Infragistics, Infragistics Bulgaria, Infragistics Friends, Infragistics Inc., PASS, SQL, SQL Saturday, SQL Server, SQL Spatial, sqlfamily, sqlpass, sqlsat311, sqlsatbulgaria, sqlsatsofia, SQLSaturday, SQLSaturday #311, SQLSaturday #311 Bulgaria, SQLSaturday Bulgaria, SQLServer 2014 | Leave a comment

How to manage Microsoft Azure Table Storage with Node.js

Node.js is one one of the the most popular growing platforms for development.  I started a series of posts dedicated to Node.js , starting with two articles about Node.js and Microsoft SQL Server ( you can see part 1 and part 2 ) .  This blog discusses how you can use Node.js and Microsoft Azure Table Storage . Open source solutions (OSS),  are very suitable for the implementation of platform independent and/or cloud applications. Node.js is widely used in the actual implementation of such cloud applications. I will try demonstrate in several blogs some details how to use Node.js with  Microsoft Azure Storage .

 

What is Azure Storage?

Microsoft Azure storage services allow us to store/retrieve the NON RELATIONAL data to/from Microsoft Cloud environment. (For relational data, SQL Azure services are used).

In Microsoft Azure Storage, the data can be stored in 4 different formats (v.i.z. Blobs, Tables and Queues, File Storage (in preview )). The retrieval/storage of the above data is done in RESTful way.

  • Blob storage stores file data. A blob can be any type of text or binary data, such as a document, media file, or application installer.
  • Table storage stores structured datasets. Table storage is a NoSQL key-attribute data store, which allows for rapid development and fast access to large quantities of data.
  • Queue storage provides reliable messaging for workflow processing and for communication between components of cloud services.
  • File storage offers shared storage for legacy applications using the standard SMB 2.1 protocol. Azure virtual machines and cloud services can share file data across application components via mounted shares, and on-premise applications can access file data in a share via the File service REST API.

 

 

This article is focused on how to handle Azure Table services with Node.js

 

Table Storage

The Azure Table storage service stores large amounts of structured data. The service is a NoSQL datastore which accepts authenticated calls from inside and outside the Azure cloud.

The Table service contains the following components:

 

 

Table Entities:

Table entities represent the units of data stored in a table and are similar to rows in a typical relational database table. Each entity defines a collection of properties. Each property is key/value pair defined by its name, value, and the value’s data type. Entities must define the following three system properties as part of the property collection:

  • PartitionKey – The PartitionKey property stores string values that identify the partition that an entity belongs to. This means that entities with the same PartitionKey values belong in the same partition. Partitions, as discussed later, are integral to the scalability of the table.
  • RowKey – The RowKey property stores string values that uniquely identify entities within each partition.
  • Timestamp – The Timestamp property provides traceability for an entity. A timestamp is a DateTime value that tells you the last time the entity was modified. A timestamp is sometimes referred to as the entity’s version. Modifications to timestamps are ignored because the table service maintains the value for this property during all inserts and update operations.

 

Consider PartitionKey, RowKey in your design. Think of PartitionKey and RowKey as being a primary index.

 

Table Partitions:

Azure Tables use keys that enable efficient querying, and you can employ one—the PartitionKey—for load balancing when the table service decides it’s time to spread your table over multiple servers. A table doesn’t have a specified schema.

 

 

Partitions represent a collection of entities with the same PartitionKey values. Partitions are always served from one partition server and each partition server can serve one or more partitions.

 

 

Dealing with an Azure Table Storage

You can use different NodeJS packages to handle Azure Table Storage. In this post we will cover azure and azure-table-node Node packages.

 

  • Microsoft Azure SDK for Node.js

It is an official Microsoft Azure SDK for Node.js. This project provides a Node.js package that makes it easy to consume and manage Microsoft Azure Services.

The listed snippets below demonstrate how to manage Azure Table service using Microsoft Azure SDK for Node.js.

 

This is easy to do since the Azure SDK will look for credentials using environment variables first. The magical environment variable names are AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY.

 

  • Create a table service

Set credentials using environment variables

   1: var azure = require('azure');

   2:  

   3: //using enviroment variables for credentials

   4: var tableService = azure.createTableService(); // implicitly use env variables

   5:  

   6: tableService = azure.createTableService(

   7:   process.env.AZURE_STORAGE_ACCOUNT,

   8:   process.env.AZURE_STORAGE_ACCESS_KEY); // explicit

   9:  

 

Set credentials explicitly using local variables

   1: var accessKey = '[accountKey]';

   2: var storageAccount = '[accountName]';

   3:  

   4: var tableService = azure.createTableService(

   5:   accessKey, storageAccount); // explicit

 

  • Insert an entity
   1: var tableService = azure.createTableService();

   2:  

   3: //insert an entity

   4:  var   task1 = {

   5:         PartitionKey : 'myPartitionKey',

   6:         RowKey: '1',

   7:         Description: 'Row description',

   8:         DueDate: new Date(2011, 12, 14, 12)

   9:  };

  10:     

  11: tableService.insertEntity('tasktable', task1, function(error){

  12:     if(!error){

  13:         // Entity inserted

  14:     }

  15: });

 

  • Query entities
   1: //query an entity

   2: var tableService = azure.createTableService();

   3: tableService.queryEntity('demotable', 'myPartitionKey', '1', function(error, serverEntity){

   4:     if(!error){

   5:         // Entity available in serverEntity variable

   6:     }

   7: });

 

 

  • azure-table-node:

It is a simplified Azure Table Storage client library for Node.js that supported:

  • creating, deleting and listing tables
  • creating, updating, querying and deleting entities
  • batch operation support
  • generating SAS (Shared Access Signature) and using it for authentication

 

Code samples below show how to use azure-table-node module to work with Azure Table Storage
 

  • Set Azure Storage credentials
   1: var azureTable = require('azure-table-node')

   2:  

   3: //set azure storage credentials

   4: azureTable.setDefaultClient({

   5:     accountUrl: 'http://[accountName].table.core.windows.net/',

   6:     accountName: '[accountName]',

   7:     accountKey: '[accountKey]'

   8: });

 

  • Create an Azure Table
   1: //create azure table

   2: app.get("/createTable", function (req, res) {

   3:  

   4:     var client = azureTable.getDefaultClient();

   5:     client.createTable('testtable', function (err, data) {

   6:     });

   7:  

   8:     client.insertEntity('testtable', {

   9:         PartitionKey: 'tests',

  10:         RowKey: '1',

  11:         value1: 'ABCDEFG'

  12:     }, function (err, data) {

  13:         res.write("Got error 😦 " + err);

  14:     });

  15:  

  16:     res.end("Table created.");

  17: });

 

  • Display an Azure Table
   1: //display an azure table

   2: app.get("/displayTable", function (req, res) {

   3:  

   4:     var client = azureTable.getDefaultClient();

   5:  

   6:     client.queryEntities('testtable', {

   7:         query: azureTable.Query.create('PartitionKey', '==', 'tests') 

   8:  

   9:     }, function (err, data, continuation) {

  10:         if (err) {

  11:             res.writeHead(500, { 'Content-Type': 'text/plain' });

  12:             res.write("Got error 😦 " + err);

  13:             res.end("");

  14:             return;

  15:         }

  16:  

  17:         var json = JSON.stringify(data);

  18:         res.writeHead(200, { 'Content-Type': 'text/plain' })

  19:  

  20:         res.end("Table displayed: " + json);

  21:        });

  22:  

  23: });

 

 

  • List  all Azure Tables
   1: //list all azure tables

   2: app.get("/listTables", function (req, res) {    

   3:  

   4:     var client = azureTable.getDefaultClient();

   5:  

   6:     client.listTables(function (err, data, continuation) {

   7:         if (err) {

   8:             res.writeHead(500, { 'Content-Type': 'text/plain' });

   9:             res.write("Got error 😦 " + err);

  10:             res.end("");

  11:             return;

  12:         }

  13:  

  14:         res.writeHead(200, { 'Content-Type': 'text/plain' })

  15:  

  16:         for (var i = 0; i < data.length; i++) {

  17:             res.write("Table[" + i + "]: " + data[i] + " " );

  18:         }       

  19:  

  20:         res.end("Tables listed." + data);

  21:     });

  22:  

  23: });

 

 

  • Delete an Azure Table
   1: //delete azure table

   2: app.get("/deleteTable", function (req, res) {

   3:  

   4:     var client = azureTable.getDefaultClient();

   5:     client.deleteTable('testtable', function (err, data) {

   6:     });

   7:     res.end("Table testtable has been deleted.");

   8:  

   9: });

 

 

There’s so much more to learn about Azure Table services and Node.  The features and capabilities of table storage continue to grow. This post is just an intro how to start, covering the base cases and most popular Node.js modules for Azure Tables. It will be useful for both – JavaScript developers who don’t have experience with Microsoft Azure and Azure developers who have less experience with JavaScript and/or Node.js.

Developers on the Microsoft Azure Platform should become familiar with how Table Storage works and how it differs from the relational databases they are used to. Knowing how table storage works will help you determine if it is a good fit for your particular requirements.

My original post is published on Infragistics community blog .

You can download source code from Git repository .

 

If you want more information about how to use Microsoft Azure Storage  & Node.js feel free to contact me at mmateev@infragistics.com

You can learn more about Node.js , Microsoft Azure and related events like Azure Bootcamp Bulgaria if you follow us on Twitter @mihailmateev  and @Infragistics and stay in touch on Facebook, Google+, LinkedIn and Infragistics Friends User Group !

Posted in Azure, Azure NoSQL, Azure Storage, Azure Table Storage, Cloud, Cloud computing, Microsoft Azure, Microsoft Azure SDK for Node.js, Microsoft Azure SQL Database, Microsoft cloud, Node, Node.js, Node.js and Azure, NodeJS, NoSQL, Open Source Solutions in Microsoft Azure, Table Storage, Windows Azure | Leave a comment

Dealing with Node.js and Microsoft SQL Server: Part-2

In the previous post we did an overview of the different Node.js drivers for Microsoft SQL Server. There was a comparison between different modules for SQL Server and were considered and their advantages and disadvantages

Developers who work mainly with Node.js and open source technologies have experience how to build and debug Node applications.  People, dealing with Microsoft SQL Server usually have more experience with Visual Studio and Microsoft platforms. It is also possible to use SQL Server Data Tools with VS

 

Node.js Tools for Visual Studio:

Node.js Tools for Visual Studio is a good solution if you want to get advantages from both – Node.js and SQL Server ( it is not a requirement – it just make development suing both technologies easier ).

The first public Alpha is released in November, 2013. Beta 1.0 is available from April, 2014 and in July is relapsed Beta 2.0

 

 

Node.js Tools for Visual Studio, aka NTVS, is a free/OSS plug-in that turns Visual Studio into a Node.js IDE. It only takes a few steps to get setup so let’s jump right into it.

You need to have installed:

 

 

NTVS supports Editing, Intellisense, Profiling, npm, TypeScript, Debugging locally and remotely (Windows/ Mac OS /Linux), as well Azure Web Sites and Cloud Service.

It id designed, developed, and supported by Microsoft and the community.

 

The interactive window is part of NTVS

 

IntelliSense exposes results of analyzing your programs in three different forms: completions, signature help, and quick info.

 

Node.js Tools allows you to create projects using the Visual Studio project system. Project files (.njsproj) reference all the source and content files associated with your project, showing them all in the Solution Explorer window and enabling NTVS to most efficiently work with your files.

 

 

You can use templates to create Node.js projects – console applications, web applications, Node.js + Express apps and Microsoft Azure Node.js apps/

 

You can also use the integrated debugger in Visual Studio

 

Below you can find examples how to start with the most popular Node.js drivers for Microsoft SQL Server

 

  • node-sqlserver-unofficial

 

The connection string – the example is given with Azure SQL database, but you can adapt it for SQL Server on premises.

   1: var sql = require('node-sqlserver-unofficial');

   2:  

   3: var conn_str = "Driver={SQL Server Native Client 11.0};

   4: Server=tcp:[database-server].database.windows.net,1433;

   5: Database=[your-database];

   6: Uid=[user]@[database-server].database.windows.net;Pwd=[your-password]; 

   7: Encrypt=yes; Connection Timeout=30;";

 

Create query using Node.js and node-sqlserver-unofficial

   1: sql.query(conn_str, "SELECT TOP 10 FirstName, LastName FROM Person.Person", function (err, results) {

   2:     if (err) {

   3:         res.writeHead(500, { 'Content-Type': 'text/plain' });

   4:         res.write("Got error 😦 " + err);

   5:         res.end("");

   6:         return;

   7:     }

   8:     res.writeHead(200, { 'Content-Type': 'text/plain' });

   9:     for (var i = 0; i < results.length; i++) {

  10:         res.write("FirstName: " + results[i].FirstName + " LastName: " + results[i].LastName );

  11:     }

  12:     res.end("; Done.");

  13: });

 

  • tedious

 

Configuration – how to configure credentials for SQL Server Database with Node.JS + tedious

 

   1: var Connection = require('tedious').Connection;

   2: var Request = require('tedious').Request; 

   3: var config = {

   4:  server: '[db-server].database.windows.net',

   5:         userName: '[user]@[db-server].database.windows.net',

   6:         password: [password],

   7:         database: ' [database] ' ,

   8:         encrypt: true // for Azure users

   9: }

 

NTLM support just landed in Tedious driver :

nerdventure.io/sql-server-and-node-js

 

Execute query using tedious.

   1: function executeStatement() {

   2:   request = new Request( "select 42, 'hello world'", function(err, rowCount) {

   3:     if (err) {

   4:       console.log(err);

   5:     } else {

   6:       console.log(rowCount + ' rows');

   7:     }

   8:     connection.close();

   9:   });

  10:   

  11:   request.on('done',function(rowCount, more) {

  12:     console.log(rowCount +' rows returned' );

  13:   });

  14: connection.execSql(request);

  15: }

 

Creating a connection to SQL Server using tedious.

   1: var connection = new Connection(config);

   2:  

   3: connection.on('connect' , function(err) {

   4:     // If no error, then good to go...

   5:     executeStatement();

   6:   }

   7: );

 

Insert Query, using tedious Node.js driver.

   1: connection.on('connect', function(err){

   2:     var request = new Request("INSERT INTO MyTable (uniqueIdCol, intCol, nVarCharCol) VALUES (@uniqueIdVal, @intVal, @nVarCharVal)",

   3:     function(err){

   4:         if(err){

   5:             console.log(err);

   6:         };

   7:     });

   8:  

   9:     request.addParameter('uniqueIdVal', TYPES.UniqueIdentifierN,'ba46b824-487b-4e7d-8fb9-703acdf954e5');

  10:     request.addParameter('intVal', TYPES.Int, 435);

  11:     request.addParameter('nVarCharVal', TYPES.NVarChar, 'hello world');

  12:  

  13:     connection.execSql(request);

  14: });

 

  • tedious-ntml

Tedious-ntlm is a  forked version of Tedious is a work in progress towards NTLM authentication.

Sample connection string is demonstrated below:

 

   1: var tds = require("tedious-ntlm");

   2:  

   3: var config = {

   4:     userName: 'dba',

   5:     domainName: "mydomain",

   6:     password: 'mypassword',

   7:     server: 'mssql-server',

   8:     options: {

   9:         instanceName: "SQL_Instance_Name",

  10:         database: "DemoDB",

  11:         debug: {

  12:             packet: false,

  13:             payload: false,

  14:             token: false,

  15:             data: false

  16:         },

  17:         encrypt: true

  18:     }

  19: };

 

  • Edge.js and edge-sql

 

Connection string / using environment variables

This is the default approach when you are using edge-sql

   1: SETX EDGE_SQL_CONNECTION_STRING "Data Source=localhost;Initial Catalog=node-test;Integrated Security=True "

   2:  

 

Query MS SQL Server directly using Edge.js

   1: var getTopUsers = edge.func('sql', function () { /*

   2:     SELECT TOP 5 * FROM SampleUsers ORDER BY CreateDate DESC

   3: */ });

 

Query SQL Server directly using Edge.js / code to set the connections in Node.js

   1: var params = {

   2:     connectionString: "Data Source=IGBGSOFEV06\\SQLEXPRESS;Initial Catalog=NodeJS;Integrated Security=True“ ,

   3:     source: "SELECT TOP 5 * FROM SampleUsers ORDER BY CreateDate DESC"

   4: };

   5:  

   6: var getTopUsers = edge.func( 'sql‘ , params);

 

Handle query results ( edge-sql )

   1: getTopUsers(null, function (error, result) {

   2:     if (error) { logError(error, res); return; }

   3:     if (result) {

   4:         res.write("<ul>");

   5:         result.forEach(function (user) {

   6:             res.write("<li>" + user.FirstName + " " + user.LastName + ": " + user.Email + "</li>");

   7:         });

   8:         res.end("</ul>");

   9:     }

  10:     else {

  11:         res.end("No results");

  12:     }

  13: });

 

 

  • Execute .NET code to query SQL Server

 

Edje.js ia a Node.js module, providing native binding to .Net world:

 

   1: var edge = require('edge') 

   2: var hello = edge.func(function() {/* async (input) => {

   3:     return ".NET welcomes " + input.ToString();     

   4: }*/})

   5: hello('Node.js', function(error, result) { 

   6:     error && throw error 

   7:     console.log(result)

   8: })

 

It is possible to create .NET library, implementing any queries, that you can create in .NET with ADO.Net and after that to import this library in your Node.js project and invoke methods using Edge.js module.

 

Create a .NET class library

   1: public class CSSample

   2:     {

   3:         public async Task<object> Invoke(object input)

   4:         {

   5:             ....

   6:         }

   7:  

   8:         public async Task<List<SampleUser>> QueryUsers(int pageNumber, int pageSize)

   9:         {

  10:             ....

  11:         }

  12:     }

 

   1: public class SampleUser

   2:     {

   3:         public int Id { get; set; }

   4:         public string FirstName { get; set; }

   5:         public string LastName { get; set; }

   6:         public string Email { get; set; }

   7:         public DateTime CreateDate { get; set; }

   8:     }

 

Import the .Net assembly and use it’s API in Node.js + Edge application  ( you should specify the method, that will be invoked )

   1: // Set up the assembly to call from Node.js

   2: var querySample = edge.func({

   3:     assemblyFile: 'EdgeSampleLibrary.dll',

   4:     typeName: 'EdgeSampleLibrary.CSSample',

   5:     methodName: 'Invoke'

   6: });

 

Invoke a specified method from Node.js

   1: // This is the data we will pass to .NET

   2: var data = { pageNumber: 2, pageSize: 3 }

   3:  

   4: // Invoke the .NET function

   5: querySample(data, function (error, result) {

   6:     ....

   7: });

 

 

The use of Node.js, Visual Studio and SQL Server makes it easy and flexible the creation of multiplatform data centric applications (on premises and in the cloud).

In the next part of this article you can learn how to use Node.js module for Microsoft  SQL Server / Azure SQL Database in Microsoft Azure applications (Azure Web Sites and Azure Cloud Services ). We will take a look at the best practices and cover different use cases.

 

My original post is published on Infragistics community blog .

 

If you want more information about how to use Microsoft SQL Server & Node.js feel free to contact me at mmateev@infragistics.com

You can learn more about Azure Bootcamp Bulgaria if you follow us on Twitter @mihailmateev  and @Infragistics and stay in touch on Facebook, Google+, LinkedIn and Infragistics Friends User Group !

Posted in Azure, Azure Blob Storage, Azure Table Storage, edge-sql, Edge.js, Microsoft Azure, Node, node-sqlserve, node-sqlserver-unofficial, Node.js, NodeJS, SQL, SQL Server, SQL Server 2012, SQLServer, SQLServer 2014, tedious, tedious-ntlm, Visual Studio, Visual Studio 2013, VSNT | Tagged , , , , , , , , , , , , | Leave a comment

Dealing with Node.js and Microsoft SQL Server: Part-1

In a series of articles will look at how to use Node.js with some of the most popular products and platforms like SQL Server, MongoDB, Microsoft Azure, how to create applications using jQuery, jQuery UI and Ignite UI with Node.js

The first post is dedicated to Node and Microsoft SQL Server.

 

Initially let’s explain why many companies and professionals prefer to use Node.js in their solutions.

 

Why Node.js?

Node.js, for those that haven’t heard of it, is essentially server-side JavaScript.

You can take a look at the some of the advantages below:

  • Practically no installation required
  • Very lightweight (one 7MB static exe for MS Windows platform)
  • Node.js encourages good software practices out of the box like async programming and inversion of control
  • Node.js uses JavaScript syntax.
  • There are more than 100 000 000 WEB developers over the world, who use JavaScript!
  • The realistic reason:
    Cross platform applications with JS will be faster and easier
  • The good parts of JavaScript are really awesome
  • One language for the browser and the server
  • Async by default
  • Over 1 million concurrent requests

 

But it’s not just another trendy programming language – companies like LinkedIn and Walmart are already using it, and many other bug IT companies  have already announced that they use Node.js or they will add Node support for their platforms. In July 2011 Microsoft ported Node.js for MS Windows and later – in November 2011 they announced Microsoft Azure ( former Windows Azure) support for Node.js

 

Node.js is used also for Microsoft Azure Mobile Services

Node is used as a default platform for the back-end. It works with Azure SQL Database and it is offered out of the box for developers.
They just need to know JSON to SQL Type Mappings

JSON to SQL Type Mappings – Azure Mobile Services with Node.js

JASON Value T-SQL Type

Numeric values (integer, decimal,
floating point)

Float(53)

Boolean

Bit

DateTime

DateTimeOffset(3)

String

Nvarchar(max)

 

There are many modules that implement support for Microsoft SQL Server. It is not easy to choose the most appropriate module for a specific case.

Which Node.js driver to choose ? 

 

The objective of this article is to summarize the more popular node.js modules for MS SQL Server. We will compare the modules and describe their advantages and disadvantages

 

Node.js Modules for Microsoft SQL Server

#N % Node.js Module
#1 20.7%

node-sqlserver

Microsoft Driver for Node.js for SQL Server

( Windows only)

#2 18.0%

tedious

A TDS driver, for connecting to MS SQLServer 

#3 12.3%

node-tds

TDS client for connecting to Microsoft SQL Server

#4 1.5%

mssqlhelper

Microsoft SQL Server database helper

#5 0.4%

mssqlx

NodeJs Microsoft SQL Server Command Line Interface

#6 0.2%

msnodesql

Microsoft Driver for Node.js for SQL Server

( Windows only)

#7 N/A

node-sqlserver-unofficial

Microsoft Driver for Node.js for SQL Server – unofficial distribution

#8 N/A Ende.js and Edge-sql
SQL compiler for edge.js. It allows accessing SQL databases from Node.js using Edge.js and ADO.NET.

 

 

  • node-sqlserver & msnodesql

Both drivers use the same code from GitHub repository – https://github.com/Azure/node-sqlserver , but using different npm packages.

This is a Microsoft’s Node.js driver for SQL Server and Azure SQL Database: It is a Node.js module, based on SQL Server Native Client 11.0 – available as Microsoft SQL Server 2012 Native Client and it can be  found in the
SQL Server 2012 Feature Pack .

There are issues with node-sqlserver / msnodesql and WIndows 7.x / Windows 8.x.
This modules require prerequisites prior to install the driver:

  1. Node.js – use the latest version if possible, but it has been tested on node 0.6.10 and later
  2. node-gyp – latest version installed globally (npm install -g node-gyp)
  3. python 2.7.x – for node-gyp (make sure it is in the path)
  4. Visual C++ 2010 – the Express edition is freely available from Microsoft
  5. SQL Server Native Client 11.0 – available as Microsoft SQL Server 2012 Native Client found in the SQL Server 2012 Feature Pack

It is an additional overhead to install these modules on the actual Windows platforms – you need to have some old versions of different libraries and frameworks. That is the reason to not recommend to use “ the official “ driver.

 

  • node-sqlserver-unofficial

This is an unofficial binary distribution of that driver (node-sqlserver /msnodesql ) using the same GitHub repository – https://github.com/Azure/node-sqlserver .
if you are planning to use this driver – there is no need to compile from source (which requires Visual Studio and totally confuses some people). It runs on both x86 and x64 and with node versions 0.8 and 0.10. You have no need to use workarounds to run node-sqlserver-unofficial with Azure Web Sites.

 

  • tedious

It is a  TDS driver, for connecting to Microsoft SQL Server databases. Tedious is an implementation of the TDS protocol, which is used to interact with instances of Microsoft’s SQL Server. It is intended to be a fairly slim implementation of the protocol, with not too much additional functionality. Tedious is pure JavaScript, as are its dependencies. (the source is CoffeeScript.) So it should run without change on any platform where Node is supported. The tedious driver is compatible with all SQL Server versions from 2000 to 2014. Later versions of TDS protocol may be supported in the future, but it is unlikely that earlier versions will be supported. You can get tedious as a npm package or from GitHub – ttps://github.com/pekim/tedious 

 

  • node-tds

This is a module that allows you to access Microsoft SQL Server 2005 and later. It is a pure JS implementation of the TDS protocol hosted on GitHub. Node-tds is similar to tedious . It could be installed as tds npm package or is source code from GitHub https://github.com/cretz/node-tds  .

 

  •  mssqlhelper

  It is a Microsoft SQL Server Helper. Mssqlhelper is mostly written in JavaScript module only from one contributor.  21% of all source code lines are comments – in comparison,  mssqlhelper has only 6% of code commented. You can install mssqlhelper npm package here or find the source code in GitHub: https://github.com/play175/mssqlhelper    

 

  • mssqlx

It is a  microsoft sql server nodejs command-line interface.  Mssqlx should work great on all platforms, especially mac and unix, without any other drivers, just nodejs. Currently, this only works on the command-line, the next version will work via stream api . This projects goal is to create an awesome cli experience for querying mssql, it hopes the follow the footsteps of the futon-cli .  You can use this mssqlx npm package or find the source code in GitHub: http://jackhq.tumblr.com/post/27992293043/mssqlx 

 

  • Edge.js and edge-sql

Edge.js is a Node.js module that allows .NET code and assemblies to run in the same process with Node.js. This potentially enables a Node.js developer to leverage technologies that have traditionally been very hard or impossible to use in the past. You can create .NET libraries with the whole logic how to connect to MS SQL Server, run query, handle the results and you can use these libraries in Node.js applications using Edge-js.

 

Creating a .NET class library

   1: public class Sample1

   2:     {

   3:         public async Task<object> Invoke(object input)

   4:         {

   5:             ....

   6:         }

   7:  

   8:         public async Task<List<SampleUser>> QueryUsers(int pageNumber, int pageSize)

   9:         {

  10:             ....

  11:         }

  12:     }

 

Using a .NET library in Node.js + Edje.js application

   1: // Set up the assembly to call from Node.js

   2: var querySample = edge.func({

   3:     assemblyFile: 'EdgeSampleLibrary.dll',

   4:     typeName: 'EdgeSampleLibrary.Sample1',

   5:     methodName: 'Invoke'

   6: });

 

Edge-sql is a SQL compiler for edge.js. It allows accessing SQL databases from Node.js using Edge.js and ADO.NET. Via edge-sql you can query SQL Server direectly using Edge.js

   1: var params = {

   2:     connectionString: "Data Source=IGBGSOFEV06\\SQLEXPRESS;Initial Catalog=NodeJS;Integrated Security=True“ ,

   3:     source: "SELECT TOP 5 * FROM SampleUsers ORDER BY CreateDate DESC"

   4: };

   5:  

   6: var getTopUsers = edge.func( 'sql‘ , params);

 

Pros and Cons

 

 

driver pros cons
tedious, node-tds

Lightweight ,
JS implementation,
no dependencies

Limited functionalities
Cannot use integrated authentication.

msnodesql, node-sqlserver

More features

Many dependencies
No actual builds
Requires custom build
Requires Windows

node-sqlserver-unofficial

The same codebase like msnodesql, node-sqlserver,
but most of the issues, related to the official distributions are fixed

No official support

Requires Windows

mssqlhelper It is a pure JS implementation of the TDS protocol Only from one contributor
Limited functionalities.
mssqlx Mssqlx works great on all platforms, especially mac and unix, without any other drivers
Based on tedious
It only works on the command-line
Edge.js and edge-sql

can run any SQL expression, can connect using integrated security

Requires .Net 4.5

Can run only on Windows

 

In the next part of this article you can learn how to use different Node.js modules for MS SQL Server. We will take a look at the best practices and cover different use cases.

My original post is published on Infragistics community blog .

 

If you want more information about how to use Microsoft SQL Server & Node.js feel free to contact me at mmateev@infragistics.com

You can learn more about Azure Bootcamp Bulgaria if you follow us on Twitter @mihailmateev  and @Infragistics and stay in touch on Facebook, Google+, LinkedIn and Infragistics Friends User Group !

Posted in Azure, Azure Blob Storage, Azure Table Storage, Blob Storage, IG, Infragistics, Infragistics Friends, JavaScript, JS, Micorosft Azure Storage, Microsoft Azure, Node, Node.js, NodeJS, NoSQL, Table Storage, Windows Azure, Windows Azure SQL Database | Leave a comment

jQuery Book (jQuery 2.0 Development Cookbook) – From newbie to experienced developers

 

I am very excited to share my impressions from the newest book about jQuery – jQuery 2.0 Development Cookbook)

The first few chapters provide a great introduction to jQuery.  The later chapters of the book cover sections on jQuery UI, jQuery Mobile and making jQuery Plugins by extending the platform.

This jQuery cookbook is appropriate for any kind of web developer even for developers with experience with web applications. Some guys who just learning web development will be able to get this book and match the theory to the practical examples. Experienced developers can use this book as a source of jQuery knowledge – The last few weeks I often associate to my cases from the book. The point is that there are solutions in this jQuery Book that everyone will benefit from.
The most important – there are a lot of practical examples from real life cases – this is the reason to say- this book is useful.

I really think you will love this jQuery 2.0 Cookbook, head over to Packt Publishing now to either get a paperback or get instant access via Ebook: JQuery 2.0 Development Cookbook .

 

 

 

I’d like to say “Thank you” to Packt Publishing for the 10 E-books that will be provided for the Azure Bootcamp Bulgaria attendees. The event was held on 29 of March n the Infragistics Bulgaria office.

 

 

 

As always, you can follow us on Twitter @mihailmateev and @Infragistics and stay in touch onFacebook,Google+andLinkedIn!

Posted in Uncategorized | Leave a comment