train and job idea customer validation brief

customer validation
1)Gather 5 freshers
2)Talk with them
3)Write some question to ask, what their problem
is the solution solve their problem.
4)Customer segment:
from smal ciity: Piler, Tirupati, Chittoor, Madanapalli, Renigunta, Rayachoti, kodur, nellore
age < 24
family income: <3 lakh="" p="">no laptop
no internet
no english or basic english skill
no tech skills or basic tech skills(c language in computerscience)
basic internet use (gmail)
basic computer use(computer usage)
parents mostly illiterate, basic education
no family relatives support.

give missed call from random number for verification

give missed call from random number for verification

saw this in wielike app.
its good

words end with us

http://www.wordfind.com/ends-with/us

words with in

http://www.wordfind.com/ends-with/in

My ideas for 2016-01-26

1)20l mineral marketplace
2)mineral water purifier (price, maintaince, installation , filter)
3)purifier buying installation
4)solar lamp on demand service
5)eseva franchise
6)vegetable shop franchise with 30k investmen
7)add related advertisement at every user fb/gogole+/tweet  share.
8)sell new toys/product with youtube channel owners
9)if you name, image of the product buy it. even its not available in your area.
ex: tech gadgets
10)Buy an youtube video episode from youtube subsribers.
Where you can put as many as annotations as per your need.
11)you can upload yout video through famous youtube channels.
12)Buy screen space of youtube screen top, bottom sections of famous youtube video.
13)dedicated toys video channel. where you can upload your toys video,
you can watch other video videos.
14)Generalize to product video channel, where you can upload video on whatever product
you buy.
15)you can buy youtube video channel.
16)you can cross promote videos across other youtube video channel.
17)Promote other youtube channel for free if you like it , once for promoting free marketing
video enterpreneurship.
18)Toprated video in segment wise
toys, tech gadgets,  dress, stories video, acting
different language, regiion, country, quality
19)youtuberank
rank the youtube channel by category, by user, by time.
20)create toys with aata (wheet flour).

1 week bootcamp for leaning software development


What special about the bootcamp?

training class
interactive class
team based learning
self aided learning
provide online aggregate materials pdf, ppt, softwares, snippets, production samples



What you can learn?
(web, android, ios, front end, backend, scripts, design, architecture, good recommendataion)

What you learn in week?
At least one l
programming language(php|node js|ruby|python)
mvc framework(code igniter, express , ruby on rails,django)
database(mysql, mongodb)
cache(redis)

What i learn in termis of desing?
Database modeling
design pattern
oop design principles
architecture
basic aws

What about deployment?
buying domain
host website on website hosting company(godaday)
basic aws usage(ec2 instance)

What about some miscellenious work ?
write code in python,ruby, node js

What about learners who can not have laptop?
We will provide laptops/desktop(limited only 20)

Who are the main customer group focused for this bootcamp?
Frehser, btech, mca, bsc computer, any one complete eduction
did not get jobs (batch>2010)

How about any one interested but not fresher , can they join?
yes but only few limited seats , as its more focus for
poor students, unemployed youth

Who will teach/train the students?
Myself (Shaik Ikbhal Basha) full time
Along with my friends in weekend, evening time 1hour every day.

Will you provide food also during bootcamp?
we will provide food on request and its paid.

What about the bootcamp venue?
I am not sure yet(planning to  PG|service apartment|business center|software company|NGO)

How the internet speed at the bootcamp?
Mostly basic browsing only that to shared internet.
Most of softwares, books, pdf we will provide on pen drive, dvd for free of cost.

Will i learn how to integrate with social network site facebook, twitter, google+?
facebook login, share,like, google login

What are the google services you teach?
Google maps, google search.

Will you teach android app develpment?
I know basic, i can teach.
But it depends on my friends availability and time.


Job consultancy will tell you whether they can find job or not within week and land job in a month.

Hi,

Job consultancy will tell you whether they can find job or not within week and land job in a month.

There lots of Job consultancy companies which will ask for your resume.
They totally forgot you.
They will process for one company. if they reject.
They don't do anything.

What if there is job consultancy, which can tell you whether they can find job or not based on their demand. Later They can help you on board within month.


How fresher can get a software job?


Whatever i write is not universal.
I am writing few them which may work.

Apply at  https://codebrahma.com/
Complete simple puzzle by writing code.

Try on Hasjobs, internship sites,
https://hiree.com/

Apply in small startups.
Work for free for 2 months
Work for small amount of money.

First get desktop computer(laptop if you can afford)
Broad band internet connection(Its must)

Software programming basics.
1)HTML, CSS, Javascript, Jquery
2)Any one language programming concepts
3)Collections
4)DB concepts
5)HTTP concepts
5)Data format JSON, XML concept
6)Event, pattern, data structure, design pattern

Java
Python
Ruby on Rails
Node js
 

5k software jobs consultancies

We are consultancies run by house wives and freshers
House wife can work as customer care
Fresher can talk to small companies, to on board other freshers.
The minimum salary is 5k , he can completed any graduation preferrably BSC computers, BCA, BTECh, MCA.
We will provide software employee on demand basis.
The person we will do all types of works like little bit operations, marketing, admin, content writing, BPO.
But they are meant for primary skills of software development, testing.

For big IITian bootstrapped startups to small service companies.
Pay only 1k for employee on boarding.

For freshers, job seekers
As optional paid service only
We will help you settle fresher in PG

How i got my idea:
I met one person in Masjid.
He was asking for some money for food.
But I did not expect this from decent looking person.
He was also tell if there is any QA Testing jobs , please refer him.
He had 1.5 years of experience, was taking 6k salary per month.
He used to stay in PG without food.
He is from place near Ananthapur.
I asked him, did you asked his parents for money.
He said, they going sent some money.
There parents are farmers.
I was asking some more questions.
Like how much farm land he has... but he was not listening.
I was saying will you work for developer position., he said yes.

Try for jobs freshers

http://www.letsintern.com/
https://hasjob.co/
ask your collques, friends in person and followup.
There some startup in BTM they will do service work .

You can search for small companies at angel.co(smal to funded companies)
http://tracxn.com/

Start with companies
https://angel.co/peersome#_=_
https://angel.co/axilor-ventures

Increase income source by business (low investment business 20k, 40k, 60k ,1lakh)

Warrent buffet suggest to increase income source.
So that if one income source fail/lost/gone. you will have other income source.
Business is one income source.

But you don't have more money to invest in business.
You can start with low investment business .

Following are low investment business.

1)Selling Ornamental Fish
 small bowl with fish(fighter fish) with food cost 240rs) in aquarium shop.
My guess is that they might be earning minimum 30%(72rs) or max o 50%(120 rs) for each such combo.
Hire person for 7k to 9k to sell bowl with fish at schools, shopping malls, bus stand, super market.

one sub experiment is that you can try selling on bike
  hanging thread tied plastic (oxigen filled) cover with fish

selling other fish (sparking small fish, fingerlings)

note: you can use construction worker for doing.
They might be easy to hire , can work for daily, weekly work.
But little training is need.

Add branded look (with basic website, small banner) say promotion offers.

2)Selling duckling at school, food street area
buy duckling at discounted rate of 25 rs, travel expense  (10rs) on bulk purchase(50)
you need scooter, four wheell pushing cart
Hire pushing cart for testing experiment.

3)Selling momo food
moving cart with food selling in area

4)selling jilebi

5)Selling vegetable

6)small tiffin center on the street
<50k p="">
7)small beauti parlour

8)recharging station , sell sim cards

9)selling plastic, plastic plates, paper plates, paper tisuee, plastic cover to food vendor.

10)selling boque flowers

11)small kirana shop

 12)meat shop

13)make food street
start with 3 small shop on street < 1 lakh

14)buy second hand auto rickshaw < 1 lakh and rent it

15)fruit seller on the streets < 40k

16)fruit, milk, curd, vegetable, meat seller for apartments as service < 20K(2 boys)

17)cross selling by exisint street vendors like food selling, artificial jewellery, lace, saux, birds, bowls with fish
18)improve technoloy of street vendor fan for sweet corner frier
19)sell chicken cabab on street
20)sell mutton kabab on street

for labour use construciton workers, part time students, part time job searchers
 

How to access command line options similar to unix commands for your python script?

import getopt
args = "--type daily --from_date 2015-12-12 --to_date 2015-12-19".split()
optlist,args = getopt.getopt(args, "", ["type=", "from_date=", "to-date"])

Fore more: https://docs.python.org/2/library/getopt.html

How to access command line arguments in python?


import sys

sys.argv[1:]#will give you a list of arguments (not including the name of the python file)

how to check key exist in dictionary in python?

if key in dict:
     print "key:", key, " exist in dict"

value= d.get("key", 0)

How to check string is empty or not in python?

a = ""
#or
a = None
if not a:
print "a is not empty"  


How to fetch Mongo documents based on query expression /condition via python?

use pymongo library to connect to Mongodb from python

Q)How to install pymongo library via setup tools?
A)easy_install pymongo

script:
import pymongo
from pymongo import MongoClient

mghost = 'localhost'
mgport = 27017
mgdbname = 'zolo_production'
mgclient = MongoClient(mghost, mgport)
db = mgclient[mgdbname]
centers = db.centers;

center = centers.find_one({'zoloCode' : pgcode})

How to import class in the current directory into other python script

reference: http://stackoverflow.com/questions/4142151/python-how-to-import-the-class-within-the-same-directory-or-sub-directory

create empty file called __init__.py
with following content to load mixpanel.py(contains Mixpanel class)
Write following where you want to load the class Mixpanel in pgreport.py
from mixpanel import Mixpanel

How to iterate dictionary in Python?

for key, value in mydict.iteritems()
      print "key:", key, ",value:", value

Website(Service) for converting xyz facebook group to android app

Website(Service) for converting xyz facebook group to android app

similarly we can do it for facebook page to android app.

use:
Branding
don't miss the updates from the group, push notification

Remaining unwanted low priority group you can see at the facebook website/app

Similarly facebook group to website.

online data collectors

Lets say you need all college in bangalore.
Lets you want all software companies in bangalore.
all startup companies in bangalore.

Collecting this information is easy , tricky, but not contain all information.

indian College database with name, phone, email , address, contact person details.

Create website with College database.

You can sent request to college.
Presecreeen each request automatically, manually.
Verify User sending request.
Paid user for verification.

Compulsary reply from college.
atleast one call for each call.

College schedule calendar with available slots for students, with amenties.
Helping setup event incollege, workshop, seminar, promotions

Teach in your free time for free in college offline

There lots of software engineer in india.
Who are bored with what to do in the weekend.
Engage software engineer with good satisfying work in the weekend.

one such activity is teaching software technologies, c, c++, java, android,html, css, angular, backbone, unity,

Some one should be there who can make appointment, schedule everything.
Follow with college in the city, select the material, topic, come with topic, discuss.

Software engineer just have to come share what they know, what they feel.

Teaching template,
How to present
Presenter group
Teaching group

Grafic designer, bakend developer, front developer, android developer, marketer, product manager group, marketing person

Group of people who work on 2 product every month.

1)Marketing person
2)Grafic designer
3)Front developer
4)backend developer
5)product manager

House wife, student, retired people telecaller work from home flexible time

Lots of small shops registered with just dial.
Whenever customer enquire with just dial, sulekha, quickr, olx.
Customer will get message with shop owner details regarding particular produt lets say big item like house inverter.
mean while shop owner will get message saying customer interested in buying product ex: house inverter

Customer call the shop owner.
or shop owner representative call the customer

Find out the customere requirement, suggest.
Price bargain,
other benefits like goodies, auxalaries

House delivery.
Installation free.

Send the installation person immediately upon confirmation.
Collect money or accept cards.

In this process  there customer convincing , suggesting, acceting orders.
Available 24/7 customer care.
This can be done by house wife, student, retired peple

based on their availability.

But the problem is that these person need to know about thed product, domain,
What to talk , suggest.
English skill,hindi, kannada... is good



industrial robot automation training center

http://difacto.com/contact-us

1)
 #18/1A, 23rd Main, Marenahalli,
JP Nagar 2nd phase, 
Bangalore, India - 560 078

2)
 #A151 & #A152, 3rd Cross 1st Stage,
Peenya Industrial Area
Bangalore, India - 560058s

india phone no:
+91 80 4212 0041, +91 80 2659 2040

Arraning Meeting of students fresher kids with famous old people

Arranging Meeting of students fresher kids with famous old people

So that young generation can learn how to achieve
what are the tips, suggestion.
What is worth doing.
What is worth sacrificing.

Famous old people can be
actor, director, actress, screen writer, music director, singer, artist, inventor, ceo, cto, cmo, coo, cpo,
army director, army generals,....

ideas on 23 october 2015

gallery for printing companies
what they did on customer consent
online
---
give freenlance work to existing known freelancer with your friend, company

Allocating elastic ip, deallocating ip, moving elastic ip

Junit fixed method order annontation

Junit test method you wrote don't follow the order of methods 
to follow the order add @FixMethodOrder on Test class

Elastic IP

Elastic IP is
1)Static IP
2)Attached with AWS account
3)Not with ec2 instance
4)You can map elastic ip to another ec2 instance.


reference: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html


Street Food India - Indian Street Food Mumbai - Malaysia Street Food (Part 11)

butane cylinder with nossil to burn

butane cylinder with nossil to burn

use this butane gas cylinder to heat, weld..

butane gas torch

Aluminium sheet /materialwelding

portable(mobile) automatic electric weighing machine

http://www.amazon.in/Digital-Kitchen-Battery-Electricity-Operated/dp/B00WK9OFLO/ref=sr_1_1?ie=UTF8&qid=1445181863&sr=8-1&keywords=electronic+weight+machine

  • Capacity: 10 kg, Accuracy: 1 gm
  • Works on 2 AAA pencil cells and has a power slot
  • Weight conversions of g / kg / lb / oz
  • Large LCD showing 5 digits and 20 mm height
  • Outside calibration, auto zero tracking, auto backlight, auto shut off, tare function, overload indicator


Portable Electronic Digital LCD Weighing Scale(Colours May Vary)

199.00 

  • Portable Electronic Scale with Superior LCD Screen, Backlight with 2 Nos. Powercell AAA Batteries
  • Suitable for Weighing Luggage, Bags, Etc. Ideal for Office, Outings, Travellers and Shopping Applications
  • Automatically Adjusts Accuracy Based on Goods and Weight
  • Multi-Unit Conversion Feature Converts Measurement Units Automatically
  • Colours May Vary

thermal bluetooth prinnter receipt printer,


Thermal bluetooth printer
cost around 4500
charge it
portable
no need to connect through wires
use bluetooth
connect with android table/phone for even more small compact functionality

search in quickr, buy in SP road, Bangalore

you need to buy thermal roll paper for printing

link: http://bangalore.quikr.com/Thermal-POS-printer-IBM-4610-for-sale-W0QQAdIdZ226313252
but this link from quickr, may not be there forever

Elastic BeanStalk command line usage create application, create environment, deploy, terminate, git branch

Elastic BeanStalk 
#create elastic bean stalk applicaiton
eb init
#create elastic bean stalk environment for current applicaiton
eb create

#push current branch the code to current default environment of current applicaiton
eb deploy

# list environment for the current application
eb list

#set default environment name for git branch
eb use

#connect to ec2 instace
eb ssh
#show slogs
eb logs


#open amazon console of elasticbean for this application
eb console

#check environment health
eb health

#sets environment variable of the current environment, current applicaton
eb setenv name="ikbhal" age=20

#print the enviroment variable of the current enviromnet, current application
eb printenv

#status of the environment
eb status
status: updating, terminating
health: Grey, Green

#terminate the environment
eb terminate

#list all the git branch
git branch

#change the git branch
git chekcout

#delete the git branch
git branch -d
note: you can not delete the current branch

#to force delte git branch
git branch -D


#merge to master
git checkout master
git merge

How to create controller in yeoman and push to aws elastic bean stalk

yo angular
yo angular:controller testController
..add some directives / views etc..
grunt server -- serves up pages correctly on port 9000
grunt -- which creates the dist folder
reference: http://stackoverflow.com/questions/18325510/how-to-deploy-a-yeoman-build-to-aws-node-js

aws cli configure with aws access key id, secret access key

aws configure
enter access key ID
enter Secret Access Key
Default regio name: ap-southeast-1 #for singpore
Default output format [none]: #nothing

Install AWS cli(command line) on mac?

reference: http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os

Requirement:
2.6.5+ or 3.3+

sudo pip install awscli

to upgrade
suod pip install --upgrade awscli

start the node js server

#install node
#npm instal if not exist
#install bower on elastic bean stalk
npm install -g bower
bower install
grunt serve
localhost:9000

How to create AWS instance profile via command line?

1)Create instance profile
aws iam create-instance-profile

2)Attach role to instance profile
aws iam add-role-to-instance-profile

# Create the role and attach the trust policy that enables EC2 to assume this role.
aws iam create-role --role-name Test-Role-for-EC2 --assume-role-policy-document file://C:\policies\trustpolicyforec2.json

# Embed the permissions policy (in this example an inline policy) to the role to specify what it is allowed to do.
aws iam put-role-policy --role-name Test-Role-for-EC2 --policy-name Permissions-Policy-For-Ec2 --policy-document file://c:\policies\permissionspolicyforec2.json

# Create the instance profile required by EC2 to contain the role
aws iam create-instance-profile --instance-profile-name EC2-ListBucket-S3

# Finally, add the role to the instance profile
aws iam add-role-to-instance-profile --instance-profile-name EC2-ListBucket-S3 --role-name Test-Role-for-EC2

What is Amazon instance profile?

if you are using AWS ec2 or AWS serive that uses AWS ec2 then
    you have to store role in intance profile
end

instance profile is container that store role
will attach to AWS ec2.

Create role for AWS service via command line

1)Create role
aws iam create-role

2)attch policy to role

2.1)Attach managed poilicy to role
aws iam attach-role-plicy

or
2.2)Attach inline policy
aws iam put-role-plicy

What is service role in AWS?

Service is role is AWS Role
this is for AWS Service
Through which we grant permission to service.

Services like: AWS ec2, AWS data pipeline, AWS ops work, AWS elastic Bean Stalk.

These resources will access AWS resources.
You can create role to determine what the services is allowed to do with these resources.

Assign the policy to role
This policy can be AWS managed policy
or custom policy
or policy base from AWS Managed policy.

Amazon ec2 instanct type c3.large

c3.large

1-YEAR TERM
Payment OptionUpfrontMonthly*Effective Hourly**Savings over On-DemandOn-Demand Hourly
No Upfront$0$71.54$0.09826%$0.132 per Hour
Partial Upfront$356$32.12$0.084636%
All Upfront$726$0$0.082937%

Create zip from only the files in the folder not the top level forlder , include hiiden files

zip ../mapp.zip -r * .[^.]*

How to delete all documents in collection in Mongo db?

Lets you collection name is dummy

db.dummy.remove({})

How to start mongo db server ?

On mac
sudo mongod

If you  want to change the db storage locaiton
sudo mongod --dbpath


How to change play.http.router parameter in playframework java

referernce : http://stackoverflow.com/questions/31509026/play-2-4-how-do-i-disable-routes-file-loading-during-unit-tests

ex: javauides.tests.routes files map to javaguide.tests.Routes class

Play's route compiler task compiles all files in conf folder ending with .routes as well as the default routes file. Generated class name is always Routes, but the package name depends on the file name. If the file name is routes (the default routes file), compiled class is placed in router package, so the fully qualified class name is router.Routes (which is the default value for play.http.router).
For all other route files, RouteCompiler derives the package name by dropping the .routes from the file name. So for my.test.routesplay.http.router value should be my.test.Routes.
Here is the base class for my tests, with custom router and db configuration elements.
public class MyTestBase extends WithApplication {
    @Override
    protected Application provideApplication() {
        Application application = new GuiceApplicationBuilder()
                .configure("db.default.driver", "org.h2.Driver")
                .configure("db.default.url", "jdbc:h2:mem:play")
                .configure("play.http.router", "my.test.Routes")
                .build();
        return application;
    }
}

What is scala twirl

Twirl is play framework scala based template engine.
https://github.com/spray/twirl

How to write class in Scala

class Point(xc:Int, yc:Int){
 var x: Int = xc
 var y: Int = yc
 def move(dx:Int, dy:Int){
  x = x+ dx
  y = y+dy
 }
override def toString():String = "(" + x + "," + y + ")";
}

android-arsenal find ui components, libraries for android

https://android-arsenal.com/
android-arsenal find ui components, libraries for android

android material design working with tabs

android material design edit text

Android material design tutorial

Coffee tea making machine

Branded coffee tea making machine.
Sell them, you make what you want, use your own materials.

coffee tea making machine branded for small business

Group people of different talent work under product, provide branding, support, calcenter support, operation support, marketing support

Group people of different talent work under product, provide branding, support, calcenter support, operation support, marketing support
Even this support can be any group member.

Chai boy branded franchise network

chai boy will come to your place give chai.
Branded chai
Quality maintained
even takes app, website.
No hassle for chai boy for money collection, record keeping.
no need of company registration for chai boy wala
Just maintain quality.
You don't know about how to make good quality.
We give good chai, you just deliver.
You collect money.


Improve small business man power vehcile 3 cycle by using electricity battery , add design sense, even network them

Improve small business man power vehcile 3 cycle by using electricity battery , add design sense, even network them

collect points for sharing selected item you buy on your social network site

collect points for sharing selected item you buy on your social network site

Coffee day branch applying

https://www.cafecoffeeday.com/lease-enquiry

Mobile Coffeeday machines with battery, solar panels

Coffeeday machine on mobile via battery, UPS, solar power on streets, movable cart

monkey runner android testing

android testing your app
do all the events

http://developer.android.com/tools/help/monkeyrunner_concepts.html

What is QSR companies

fast food companies like McDonald, Subway, ..
They have franchise, supplied matrial franchisers, they sell, collect money from franchiser
Market the product on tv, internet
offers
technology
app, website

Yum brands

Yum! Brands, which operates KFC, Pizza Hut, and Taco Bell in India,” says Gaurav. For KFC, ColdEx manages daily pickups from 80 vendors and delivers frozen goods to six Yum! Brands distribution centres in a -18°C environment.

Promote your product with Working marketing executive as part time

You have good product/servie(website/app/anything)
You need market help, leverage part time marketing exeutive who working in other comapnies.
Even leverage their contact
If you like in future, you can onboard them as full employee.
If he is super talent make him part of founding team

ex: marketing exective in wipro, logistics

AWS Dynamo DB operations

package com.amazonaws.codesamples.datamodeling;

import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapperConfig;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;

public class ObjectPersistenceCRUDExample {
    
    static AmazonDynamoDBClient client = new AmazonDynamoDBClient(new ProfileCredentialsProvider());
        
    public static void main(String[] args) throws IOException {
        testCRUDOperations();  
        System.out.println("Example complete!");
    }

    @DynamoDBTable(tableName="ProductCatalog")
    public static class CatalogItem {
        private Integer id;
        private String title;
        private String ISBN;
        private Set bookAuthors;
        
        @DynamoDBHashKey(attributeName="Id")
        public Integer getId() { return id; }
        public void setId(Integer id) { this.id = id; }
        
        @DynamoDBAttribute(attributeName="Title")
        public String getTitle() { return title; }    
        public void setTitle(String title) { this.title = title; }
        
        @DynamoDBAttribute(attributeName="ISBN")
        public String getISBN() { return ISBN; }    
        public void setISBN(String ISBN) { this.ISBN = ISBN;}
        
        @DynamoDBAttribute(attributeName = "Authors")
        public Set getBookAuthors() { return bookAuthors; }    
        public void setBookAuthors(Set bookAuthors) { this.bookAuthors = bookAuthors; }
        @Override
        public String toString() {
            return "Book [ISBN=" + ISBN + ", bookAuthors=" + bookAuthors
            + ", id=" + id + ", title=" + title + "]";            
        }
    }
        
    private static void testCRUDOperations() {

        CatalogItem item = new CatalogItem();
        item.setId(601);
        item.setTitle("Book 601");
        item.setISBN("611-1111111111");
        item.setBookAuthors(new HashSet(Arrays.asList("Author1", "Author2")));
        
        // Save the item (book).
        DynamoDBMapper mapper = new DynamoDBMapper(client);
        mapper.save(item);
        
        // Retrieve the item.
        CatalogItem itemRetrieved = mapper.load(CatalogItem.class, 601);
        System.out.println("Item retrieved:");
        System.out.println(itemRetrieved);

        // Update the item.
        itemRetrieved.setISBN("622-2222222222");
        itemRetrieved.setBookAuthors(new HashSet(Arrays.asList("Author1", "Author3")));
        mapper.save(itemRetrieved);
        System.out.println("Item updated:");
        System.out.println(itemRetrieved);
        
        // Retrieve the updated item.
        DynamoDBMapperConfig config = new DynamoDBMapperConfig(DynamoDBMapperConfig.ConsistentReads.CONSISTENT);
        CatalogItem updatedItem = mapper.load(CatalogItem.class, 601, config);
        System.out.println("Retrieved the previously updated item:");
        System.out.println(updatedItem);
        
        // Delete the item.
        mapper.delete(updatedItem);
        
        // Try to retrieve deleted item.
        CatalogItem deletedItem = mapper.load(CatalogItem.class, updatedItem.getId(), config);
        if (deletedItem == null) {
            System.out.println("Done - Sample item is deleted.");
        }
    }
}

          

Amazon Dynamo DB java maven


com.amazonaws
aws-java-sdk-dynamodb
1.10.26

Singapore Dynamo db pricing

  • Write Throughput: $0.0074 per hour for every 10 units of Write Capacity
    (enough capacity to do up to 36,000 writes per hour)*
  • Read Throughput: $0.0074 per hour for every 50 units of Read Capacity
    (enough capacity to do up to 180,000 strongly consistent reads, or 360,000 eventually consistent reads, per hour)*

Dynamo db FAQ

Dynamo db free quota details

Free Tier*
As part of AWS’s Free Tier, AWS customers can get started with Amazon DynamoDB for free. DynamoDB customers get 25 GB of free storage, as well as up to 25 write capacity units and 25 read capacity units of ongoing throughput capacity (enough throughput to handle up to 200 million requests per month) and 2.5 million read requests from DynamoDB Streams for free.

Migrating from Mongodb to Dynamo db

referernce: https://www.codementor.io/devops/tutorial/handling-date-and-datetime-in-dynamodb


Dynamo Db does not support multiple indexes
It supports only Hash key, hash key + range key only
Does not support native date, DateTime object

Advantage:
No worries of scaling, monitoring, security updates.
average good response.

Use unix time stamp, store as Number
Combine multiple mongo db key if required
Database denormalization
Based on query patter, create schema

Dynamo DB is  NO SQL db

Queries are slow
GetItem call as fast

Terminology
Table , Item, Attribute, Primary Key, hash attribute value, hash and range attribute values
secondary index on non key attibute value

Start the dynamo db locally
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -help
Dynamo db port: 8000

Create table
var params = {
  TableName : "Music",
  KeySchema:[
    {AttributeName:"Artist", KeyType:"Hash"},
    {AttributeName:"SongTitle", KeyType:"Range"}
  ],
  AttributeDefinitions:[
     {AttibuteName:"Artist", AttibuteType:"S"},
     {AttibuteName:"SongTitle", AttibuteType:"S"},
  ],
  ProvisionedThroughput:{
      ReadCapacityUnits:1,
      WriteCapacityUnits: 1
  }
};
dynamodb.createTable(params, function(err, data){

});

TableStatus is should be Active

2)
var params = { TableName: "Music" }; dynamodb.describeTable(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

3)
var params = {}; dynamodb.listTables(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

4)

var
params = { TableName: "Music", Item: { "Artist":"No One You Know", "SongTitle":"Call Me Today", "AlbumTitle":"Somewhat Famous", "Year": 2015, "Price": 2.14, "Genre": "Country", "Tags": { "Composers": [ "Smith", "Jones", "Davis" ], "LengthInSeconds": 214 } } }; dynamodb.putItem(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

primarykey is must, remaining attribute are optional

5)Condition Expressoin

var
params = { TableName: "Music", Item: { "Artist":"No One You Know", "SongTitle":"Call Me Today", "AlbumTitle":"Somewhat Famous", "Year": 2015, "Price": 2.14, "Genre": "Country", "Tags": { "Composers": [ "Smith", "Jones", "Davis" ], "LengthInSeconds": 214 } }, "ConditionExpression": "attribute_not_exists(Artist) and attribute_not_exists(SongTitle)" };

6)Batch insert
var params = { RequestItems: { "Music": [ { PutRequest: { Item: { "Artist": "No One You Know", "SongTitle": "My Dog Spot", "AlbumTitle":"Hey Now", "Price": 1.98, "Genre": "Country", "CriticRating": 8.4 } } }, { PutRequest: { Item: { "Artist": "No One You Know", "SongTitle": "Somewhere Down The Road", "AlbumTitle":"Somewhat Famous", "Genre": "Country", "CriticRating": 8.4, "Year": 1984 } } }
]}

7)Dynamo db data types
String, number, float, map, list

8)
var params = { TableName: "Music", Key: { "Artist": "No One You Know", "SongTitle": "Call Me Today" } }; dynamodb.getItem(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });
9)
var params = { TableName: "Music", Key: { "Artist": "No One You Know", "SongTitle": "Call Me Today" }, ProjectionExpression: "AlbumTitle" };
10)
var params = { TableName: "Music", KeyConditionExpression: "Artist = :artist", ExpressionAttributeValues: { ":artist": "No One You Know" } }; dynamodb.query(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

11)
var params = { TableName: "Music" }; dynamodb.scan(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });
Operations

12)

var
params = { TableName: "Music", AttributeDefinitions:[ {AttributeName: "Genre", AttributeType: "S"}, {AttributeName: "Price", AttributeType: "N"} ], GlobalSecondaryIndexUpdates: [ { Create: { IndexName: "GenreAndPriceIndex", KeySchema: [ {AttributeName: "Genre", KeyType: "HASH"}, {AttributeName: "Price", KeyType: "RANGE"}, ], Projection: { "ProjectionType": "ALL" }, ProvisionedThroughput: { "ReadCapacityUnits": 1,"WriteCapacityUnits": 1 } } } ] }; dynamodb.updateTable(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

13)
var params = { TableName: "Music", Key: { "Artist":"No One You Know", "SongTitle":"Call Me Today" }, UpdateExpression: "SET RecordLabel = :label", ExpressionAttributeValues: { ":label": "Global Records" }, ReturnValues: "ALL_NEW" }; dynamodb.updateItem(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

15)Automatic counter

15)
var params = { TableName: "Music", Key: { Artist: "The Acme Band", SongTitle: "Look Out, World" } }; dynamodb.deleteItem(params, function(err, data) { if (err) console.log(JSON.stringify(err, null, 2)); else console.log(JSON.stringify(data, null, 2)); });

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/BestPractices.html

refernce: http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.Java.html