Tuesday, March 4, 2014

How to connect to MySQL database from Android

Every app developer that needs to show data between app users, have come to a situation where he need to have a centralized database between all his apps to sync the data. The trouble is that the app developers have hardly any skills with web development technologies or the web api. What actually you need in this situation is a server side layer which lets you communicate with your database.

How it works?

Android App ->(data)-> Server Side Scripting -> Database

In the above model, data could be in any format such as JSON or XML. The server side scripting could be in PHP, ASP.NET, Java, Ruby on Rail, Python etc.

Keeping your database directly accessible from the internet and saving database passwords inside of the app, probably is not the safest solution. The additional server side layer adds complexity to your project, as it needs you to learn a whole lot of things. The best way is to collaborate with a PHP or ASP.NET developer to get the server side logic done. But that would be share your profit too.

Recently I have came accross a website, that can let you do this thing without the need of a developer. https://www.dreamfactory.com/ that is Dream Factory framework create a bunch full of REST based API out of your database automatically giving you the power to control your database from the mobile app directly without the need of a server side technology. I am not sure how successfully or safe this is, but as its open source you can definitely give it a try.

Wednesday, March 27, 2013

What is caching and how it is useful in web development?

A lot of people have learn about caching in their academics, but a lot of people never get a chance to use it especially if you are in your initially years of PHP development. So, here's a short brief about what it is and further reading guide.

What it is?
Caching is a technology where you utilize file system or other fast access memory to temporary store data which is used frequently instead of getting it from database every time. So, if you have a website like ours, where you have published say 1000 articles. When a person views an article the system goes and search for the article content from the database of 1000 articles which is a time consuming operation. While we know that when you publish a new article, most of the people will be viewing that article only. So, if you save that article in temporary memory for 1 hour and there are 100 request in that one hour. All those request will see the content from fast temporary memory, instead of searching it in the whole database.

Why you should use it?
As you can see from the example above, you need to use it to optimize your web application. It has a lot of benefits as compared to traditional sql database in certain situations.

Where you should use it?
You should use it to optimization your application when you have a heavy traffic website and you need to fetch the same data from database repetitively.

If you know other better uses of caching be sure to put a comment and we will include it.

Here is an example implementation of caching in PHP:
http://cachingtutorial.blogspot.in/

Friday, March 8, 2013

Selecting the best technology for your next website project (small or mid scale)

If you are planning to launch a new web application or a website, it gets hard to select the right technology for it. If you are already expert in one technology you may wish to stick with it, but if you are not and you are starting completely new with it, here are a few options to consider:


  • ASP.NET (from Microsoft)
  • JSP (from Java/Oracle)
  • PHP (most popular open source framework)
  • Python 
  • Ruby on Rails
Selecting the best option is still a big question. As mentioned above, ASP.NET is developed and actively maintained by Microsoft and is probably the best option if you plan to build a enterprise application. JSP is also a good option for it, but both this options have high development and initial costing. Comparatively, PHP, Python and Ruby on Rails could be cheaper in terms of development cost or initial software licence costing.

Among the open source technologies, PHP is most widely used and you can find more developers as compared to Python or Ruby on Rails. And they are cheaper as well but mind it, the quality and knowledge of developers has to be tested before you can begin, as there are lot of developers, who are not actually capable of building a great website. 

You can find more information and comparison on the following website:

Thursday, February 14, 2013

Welcome

Welcome to web development tips blog, where you can learn something new and useful about web development. We feature articles with different topic, tips and tricks that relates to website development and that would help you to learn something new interesting which you may never thought about.

If you want to submit your article, or found something interesting, which you think would be helpful to our users, please forward it to happyhardik(at)gmail.com and we will feature it.