Sharding is the process of partitioning data across multiple servers using a shard key. It solves the problem with horizontal scaling. As the size of the data increases, a single machine may not be sufficient to store the data. With sharding, you add more machines to support data growth. If you are new to MongoDB then please read my previous post how to start mongoDB.
Sharding setup requires the following:
- Mongodb Configuration server – this stores the cluster’s metadata
- Mongos instance – connecting the config server(s)
- Individual mongodb instances – these act as the shards.
In this tutorial, we’re going to take a look at Elasticsearch and how we can use it in PHP. ElasticSearch is an open-source and distributed search engine which is very much scalable. We can use it to perform fast full-text and other complex searches. It also includes a REST API which allows us to easily issue requests for creating, deleting, updating and retrieving of data. You can read about Elastic Search at: https://www.elastic.co/products/elasticsearch
Download ElasticSearch from https://www.elastic.co/downloads/elasticsearch. This tutorial will assume you’re using a Windows environment. For Windows – it’s a Zip file – one can extract it into C:\elasticsearch-2.2.0\.
MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on concept of collection and document.
Install MongoDB On Windows
To install the MongoDB on windows, first download the latest release of MongoDB from http://www.mongodb.org/downloads. Make sure you get correct version of MongoDB depending upon your windows version.
MongoDB need a folder (data directory) to store its data. By default, it will store in “C:\data\db”, create this folder manually. MongoDB won’t create it for you. You can also specify an alternate data directory with –dbpath option to mongod.exe, for example:
There are two ways to make your web app into an Android app using PhoneGap. One is a no-pain ultra easy way, and another way is a manual way using Cordova CLI with an Android SDK.
Option 1: Android Apps with PhoneGap Build
Using PhoneGap Build is absolutely painless. All you need to do is zip up your web app, upload it to Adobe PhoneGap Build cloud, and the service takes care everything for you. You don’t even need to download and set up SDK or emulators.
- Write a web app
- Zip it up
- Upload the zip file to PhoneGap Build cloud. Click Ready to Build. Edit the name of the app and upload an app icon too.
- Download the apk and install it on your phone
Option 2: Full Development with PhoneGap Cordova CLI
You can install Cordova command-line interface (CLI) tools and Android SDKs for full development with taking advantage of the plugins that enable for you to use hardware APIs, push notifications and more, and debugging.
Creating Hello World
Web services make it easy for mobile devices to communicate with applications running on a web or application server. I am sharing how to implement an Android client for services implemented according to the REST approach. This tutorial shows how you send HTTP requests, parse JSON string responses and display the results in a ListActivity, showing a progress dialog while loading.
Already I have written a Restful web services using PHP and MySQL. You can refer here.
This file contain Asyncronous server request to get json data and parse that json data.
A notification is a message you can display as an icon at the top of the device which we call notification bar or status bar. The user can expand the notification bar and by selecting the notification the user can trigger another activity. In this tutorial we are going to see how to send Notifications with sound from your Android Application and open the Notification in a new Activity.
The notification is sent when the button is clicked. It is initialised by the function startNotification(). We use NotificationCompat builder to create the notification. setContentTitle() is used to set the title message. setContentText() is used to set the notification message. setTicker() is is used to set the Alert message. setSmallIcon() is used to set a icon image for our Notification. setSound() is used to set sound for Notification. NotificationView.java is the result class which is Initialised, and it opens when the notification is clicked. build() is used to display the notification.