How does a Silverlight client access Azure stored data? - silverlight

I am thinking of developing a Silverlight application and want to make use of Windows Azure for the data storage (as well as scalability etc). But I am not sure how to get data to and from Azure using Silverlight. What technologies should I be investigating? What is the recommended approach for this scenario?
Should I be looking at using the Entity Framework from Silverlight? But then how would the EF get data from Azure and even more importantly get changes saved back again? Or do I need to go for something more custom?

Check out .NET RIA Services:
Build a Simple Application with .Net RIA Services (Silverlight 3)
Creating applications with .NET RIA Service Part 1 - Introduction

Basically, you're going to use Azure Table Storage to store the data and Blob storage if you have really large (> 64K) data elements. Table Storage and Blob Storage have REST interfaces, and you should look at the StorageClient sample in the Azure SDK as a way to CRUD the data. You can use these interfaces (Table and Blob) exclusively if you don't plan on exposing a public API.
However, lets say you want to be the next Twitter, and you want to expose a REST interface to the public... Even though Azure Table Storage has it's own REST interface, you create a small WCF service in a web role that exposes some specific WCF methods in a more compelling way. You can also publish your data in JSON, which could be more useful to non-Windows data consumers.
Here's a page that I found really helpful:
Azure Application Part 3: Expose (REST) Web Service And Consume in Silverlight.
And if you'd like to see my example, http://www.netalerts.mobi/traffic exposes data that's stored in Azure Table Storage. http://www.netalerts.mobi/traffic/api.aspx describes the REST apis that are public. In my implementation I call Table Storage via REST, manipulate the data, and then serve it up again in the public api.

Related

exporting data for analytics use in SaaS

We are a SaaS product and we would like to be able have per-user data exports that will be used with various analytical (BI) tools like Tableau or PowerBI. Instead of just managing all those exports manually, we thought of using some cloud database such as AWS Redshift (which will be part of our service). But then, it is not clear how is user will access those databases naturally, unless we do some kind of SSO integration with AWS.
So - what is the best practice for exporting data for analytics use in SaaS products?
In this case you can build your security in to your backend API layer.
First you can set up processes to load your data to Redshift, then make sure that only your backend API server/cluster has access to redshift (e.g. through a vpc with no external ip access to redshift)
Now you have your data, you can validate your user as usual through your backend service, then when a user requests a download through the backend API, the backend can create a query to extract from redshift only the correct data based upon the users security role. In order to make this possible you may need to build some kind of security column into your redshift data model.
I am assuming getting data to redshift is not a problem.
What you are looking for, if I understand correctly is a OEM solutions.
The problem is how does one mimic the security model you have in place for your SaaS offering.
That depends on how complex is your security model.
If it is as simple as just authenticate the user and he has access to all tenant data or the data can be easily filtered for user. Things are simple for you. Trusted authentication will allow you to authenticate that user and user filtering will allow you to show him all that he has access to.
But here is the kicker, if your security is really complex , then it can become really difficult to mimic it within these products.
Here for integrating tableau this link will help:-
https://tableau.github.io/embedding-playbook/#
Power BI, this product am not a fan off. I tried to embed a view in one my applications and data refresh was a big issue.
Its almost like they want you to be a azure shop for real time reporting.( I like GCP more )
If you create the api's and populate datasets then they have crazy restrictions like 1MB/sec etc.
On the other instances datasets can be refreshed only 8 times.
I gave up on them.
Very recently I got a call from Sisense and they seemed promising as well from a OEM perspective. You might was to try them.

WPF Client on Windows + WebService on a Linux server

Currently I am developing a WPF application which will handle alot on the client (non business logic that is).
Some data (the business logic) will be coming from a SQL database. To expose this data to the client I was thinking to create a WebService. Normally I would use a WCF Service (or Web Api) to fix this. But in this scenario, there is only a linux server available using a MySQL database, on this server I am unable to host a WCF Service.
I was wondering how I could implement the following:
Users opening the WPF client need to authenticate to the MySQL database.
Users logged in should retrieve some of their personal data coming from the MySQL database.
Which kind of Webservice or technology is the best to go for?
Thanks
You can build a web service in any language, so it comes down to which ones you're comfortable with, or which offer the best tools. If you or your team are already heavily invested in the Microsoft stack, you could try something like Monodevelop: http://monodevelop.com/

Cross-Platform Mobile Application Solution

I am developing an mobile application which can be run on mobile devices (with OS like Android, iOS, WP7...). This application will get data from online database then store them to local database in device and I can do CRUD with data. There are three ideas:
I'll create a webservice to handle with database on host and use some cross-platform framework to building an app then connect to webservice in order to get and put data to server. Issues:
Which technology should I use to create webservice? (RESTful/SOAP...?)
Which type of return data for easy to handle? (XML/JSON...?)
How to sync between local database and database on host?
I'll make an application for loading an external URL and build a website (with all of features that I need to work with database). Issues:
iOS, Android, WP7... accept for loading external URL in applications?
How to sync data like my first idea?
Should I use single page application technology?
I'll make an application using cross-platform framework and it will work with local database. I just handle syncing between local database and host database. Issue: which is the best database and best framework to do this?
Thank you
How to sync between local database and database on host?
For synchronization, you can take a look at the open source project, OpenMobster's Sync service. You can do all types of sync operations
two-way
one-way client
one-way device
bootup.
Besides that, all modifications are automatically tracked and synced with the Cloud. You can have your app offline when network connection is down. It will track any changes and automatically in the background synchronize it with the cloud when the connection returns. Also, when new data is created in the Cloud, it is automatically synchronized with the local database using Push notifications.
Currently only native development is supported on Android and iOS. However, the next release which is 2.2-M8 (end of March) will support end-to-end integration with PhoneGap on Android and 2.2-M9 (end of April) will add iOS.
Support for PhoneGap will give you the flexibility to build the app using web technologies like HTML5, and JavaScript along with Sync for your local data using OpenMobster.
If you want to go pure native, then you still can use the Sync service and synchronize your local database with your remote database.
Let me know if you have more questions about the framework
Here is a link to the open source project: http://openmobster.googlecode.com
Good Luck!!!
Some suggestions:
If you're planning that your mobile application exchanges data with a server, i strongly suggest you to use RESTful Services. The XML overload associated with SOAP services might get your phone and your network into trouble
The return data can be either JSON or XML. For example, in Blackberry applications i prefer XML because the support included in the SDK.
There are three kinds of mobile applications: Web applications (build with HTML/Javascript and accessed throw a Browser), Native applications (installed in the device and coded in Java/Objective-C or another language) and Hybrid applications (installed in the device but coded in HTML/Javascript and can access some features of the OS). Your URL-Loading type sounds like an Hybrid approach (not quite sure about that), so you can use PhoneGap to build that type of applications.
Hybrid and Web applications uses the capabilities of the phone browser to manage HTML/JavaScript. Now the devices come with very powefull WebKIt-based Browsers, so the single page pattern would work with no problem. Although, it's kind of a wear approach to mobile application design.
I don't see the need of a local database in your app, you can simply handle all the data in the server and access it through RESTful Services on the phone.
I am developing an mobile application which can be run on mobile
devices (with OS like Android, iOS, WP7...). This application will get
data from online database then store them to local database in device
and I can do CRUD with data
Nice!!!
Which technology should I use to create webservice? (RESTful/SOAP...?)
I Will go For REST services.
REST has advantages when:
You have a set of resources that you want to manipulate.
You want to support navigation between resources.
You need scalability.
SOAP has advantages when:
You want to publish a web service description (using WSDL).
WSDL 2 can describe RESTful web service as well. WADL is an alternative to WSDL for RESTful web services.
You want to use security etc. that relies on the use of SOAP headers or some similar mechanism in which data is added and removed from a request.
You want better tooling support.
You want tested platform interoperability.
Which type of return data for easy to handle? (XML/JSON...?)
I personally go for XML
Its not a criteria of which is easy to handle.Its about performance in Mobile applications.
JSON is generally smaller than a XML document and there for faster to work with.JSON can be parsed more efficiently because it can be parsed as JavaScript, which the built-in eval() function will do for you.
How to sync between local database and database on host?
Create a service which contains a timer and runs in background.Call the REST service at intervals to get the latest values. But Since this is a polling kind of thing,then it is not efficient and has less performance. Other Approach will be use of PUSH notifications.As soon as there is any change at the server side, send a push notification to the client(mobile) and hence perform the local database operations.
iOS, Android, WP7... accept for loading external URL in applications?
I didn't understand this point.What you want actually?
Should I use single page application technology?
Single page technology is very good.But it will depend on your business.If it is possible then use it.Else create different HTML pages.
I'll make an application using cross-platform framework and it will work with local database. I just handle syncing between local database and host database. Issue: which is the best database and best framework to do this?
Choosing of the database will depend upon choosing of the cross platform mobile framework.Phonegap is exactly what you need. And the database will be sqlite. Phonegap provide API's for storage,so you can easily access the database of the different mobile platform.

What is a web service?

Could someone please explain to me in a simple way, what is a web service?
Please correct me if I'm wrong. I have a DB hosted somewhere in the web, and I want to perform DB transactions from a desktop application as well as a mobile application. Can this be done through a web service ? Someone mentioned it to me and I wanted to make sure this could happen.
Here's a good explanation on Wikipedia.
A middle dynamic content processing and generation level application server, for example Ruby on Rails, Java EE, ASP.NET, PHP, ColdFusion platform
The middle tier of a 3-tier application is often the web service
i want to perform DB transactions from a desktop application and a mobile application, can this be done through a web service ?
This is Exactly what a web service is for.
A web service allow you to create multiple front ends if needed, and serve your database data to all of those front ends. You can also open up the API and allow third party developers to access the web service and thereby access the data of your application in a controlled environment.
It's considered a better practice for larger applications to access a web service or a middle tier rather than directly access the database.
In your case, a web service would involve setting up your DB behind a web server that listens for incoming requests, performs the appropriate DB operations, and returns whatever data is appropriate. Then, your desktop and mobile applications could send a http request and the DB would respond appropriately. This would let all your applications access the same DB.

SharePoint 2010 Silverlight application server object model?

I am currently getting myself up to speed with SharePoint 2010 and I am working my way through the different way SharePoint can expose silverlight applications.
As I understand it, the client object model is more restricted, and is for other applications to interact with SharePoint via WCF for example. An example would be a custom build system that retrieves reference data from SharePoint lists.
The server object model provides more functionality in SharePoint. One example is code written for a web part.
I have been told to deploy a silverlight application, you create the xap, make it accessible by SharePoint web front end, create a silverlight web part and point to it.
So, my question is, assuming what I have previously mentioned is more-or-less the case, can SharePoint access the server object model or is it the same as an external system for example, and uses the client object model?
I am learning all of this so happy to receive feedback on anything I may have not understood correctly.
You would access the client object model from Silverlight. Silverlight is a client. It runs in the user's browser, so it is not on the server, and therefore cannot access the server's features except via service calls. The client object model will provide you direct integration with various lists and functions, and makes it very easy to integrate.
Check out this video for more:
http://channel9.msdn.com/learn/courses/SharePoint2010Developer/ClientObjectModel/SilverlightClientObjectModel/

Resources