IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New So using AWS directly via AJAX?
Or is there a layer in between the mobile and the end service?

If no layer, how is security handled?

Incidentally, Django isn't just an "HTML templating framework"... I'm using it as a front-end to AWS right now. There are a few honest to goodness HTML pages that are served from it (login, main page filled with Javascript, and subscription signup) but for the most part it's a single page application with all AJAX behind it. The ORM, REST interface, S3 integration, and so on are all value add even if you're producing no actual HTML at all.

Phonegap wouldn't work for our purposes; the HTML media controls are too wonky still, even in 2013. We've got a mobile HTML version of the site but will be replacing it with native clients soonest just so they'll work reliably.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: So using AWS directly via AJAX?
We are using elastic beanstalk which gets you autoscaling and load balancing for http/https. Auth is handled directly in each endpoint. The signup action vends a token that every other action validates before doing anything else. Because auth records are accessed every hit, they, along with user account info, are stored in dynamodb because it is good at keyed lookup. Further, it is fronted by elasticache so the Auth record lookup comes out of the cache most of the time.

Based on some other threads in this forum I hesitate to tell you I chose php for our main server. :-) There were good reasons to choose it. It was the simplest thing that could work, the deployment model is bog simple (I'm sick of seeing gateway error on stuff like rails because the app process died), the aws php client library v2 is excellent, and we don't need an orm, session management, or HTML templating. Just access to data stores, some scripting, and JSON rendering. Also, consider our app logic is about 75% written in JavaScript and If you look at the list of language gotchas (type conversions are messy, busted == operator, etc) they are very similar so we adopt practices that protect us in both languages and the cost of switching from server to client work is conceptually very low.

EDIT: Yes, we are kind of fronting the other aws services in the main elastic beanstalk. Although I'm considering switching to direct to S3 uploads.
Expand Edited by TB D April 27, 2013, 06:58:44 PM EDT
New Re: So using AWS directly via AJAX?
The signup action vends a token that every other action validates before doing anything else. Because auth records are accessed every hit, they, along with user account info, are stored in dynamodb because it is good at keyed lookup. Further, it is fronted by elasticache so the Auth record lookup comes out of the cache most of the time.

In other words, session management. ;-)

This is nearly the exact same thing the Django contrib.auth module does, fwiw.

I'm sick of seeing gateway error on stuff like rails because the app process died

Well, Rails sux anyways, but if you're seeing gateway errors then you're not using supervisord or something similar. Understood on the simplest thing that works though. Different people just have different definitions of simplest.

As an example, there's a REST plugin for Django called Tastypie. Create your model definition in the ORM, tell Tastypie to serve it as a resource, and suddenly you have a full RESTful API with both list and detail endpoints, GET/POST/PUT/PATCH/DELETE support, authorization/authentication, XML/JSON/YAML responses based on content-accepts, and so on. It's seriously 15 minutes from blank page to functioning interface.

That said, the learning curve is there, and if you've already spent it elsewhere why change.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: So using AWS directly via AJAX?
>In other words, session management. ;-)

I guess - although our "session" is nothing more than identity management.

> if you're seeing gateway errors then you're not using supervisord or something similar.

Well that's the thing about elastic beanstalk - its a canned environment - you take what you get WRT environment and if you can't deploy what you need out of git - you're screwed. Autoscaling is a new game - if you have to telnet to your box to install stuff you've already lost it. When beanstalk spins up a new machine, it installs a default environment and does a git pull on a specific version number and that's pretty much it.

Anyhow, PHP eliminates the need to "use" anything else at all. Its all there.

Not sure what the python environment provides by default but it appears to be flask or django. http://aws.amazon.co...-with-amazon-rds/

I guess I should also mention that my partner started our app using what he knew and version zero was written using VB.net, IIS, and MSSQL - the only server technologies he knows. He did most of our UI and he is a brilliant UI guy and relentless polisher of experience but server stuff isn't his thing. Once I joined him in the venture, I got him to move from MSSQL to mysql in a weekend, and I ported his VB.net to PHP and he has since embraced it since it is very close to javascript. Also - we are planning for super high volume and every action is basically a page of PHP with hand tuned SQL. The whole service runs on about 30 actions and each one is about 1-2 pages of pretty straight forward code using PDO and some custom PHP library I wrote atop dynamodb. Whole product took the two of us six months to build and we have iOS, Android, Mac (there's a Phonegap for Mac), and web versions build on the same code base.

I'm pretty sold on building standalone apps in HTML/JS/CSS. I don't see me going back to building web pages anytime soon.
New Re: So using AWS directly via AJAX?
EBS uses WSGI, just like a supervisord installation would. If I had the time I would look into it more closely, but I do know that it's only Python 2.6 and I need 2.7. I've also got some C++ that needs to be installed for the application to work (Google's OR tools).

With respect to telnet for installs, that's the crux of one of the questions I was going to ask you:

Right now I've got a very nice Ansible setup for automated installation and management of the system I'm currently building (which I won't describe now due to NDAs, but it should be released within a few weeks or so). The client had originally chosen a local IaaS provider that proved to be insufficient, so I did a survey of enterprise-class environments. AWS won over Azure (don't laugh, if it hadn't been for Amazon's pricing Azure might have won the contract), but now I need to translate my devops stuff to a different platform.

The Ansible scripts idempotently ensure the environment is configured correctly, update the code from github, update the database schema and migrate data if necessary, then restart the system. All via ssh, which is obviously problematic in AWS when an instance gets a new IP at restart. I could use 10.x addresses in a private VPC but I'm on a short schedule and want to change as little as possible during the initial port to AWS.

My approach so far is to create a management instance, use it to build and save a new AMI snapshot from the updated application code, down the existing instances, snapshot and update/migrate the database, then bring up new instances on the updated AMI. All of this is a bit of a pain in the ass, but it's what our AWS Partner contact suggested.

Since you're using Beanstalk you may not have considered any of this (apart from saying, gee, glad I don't have to do that), but if you've got any suggestions I'm all ears.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: So using AWS directly via AJAX?
EBS is nice when its just what you need and not so nice when it isn't. Sounds like it isn't.

The thing is - EBS is really just a nice ribbon and bow over a few specific Cloud Formations.

So I would build your own from the ground up - you can create a custom stack, custom ami's, etc and do that.

I haven't dug too far into it because EBS is fine for me - only thing I deploy is PHP and some static web resources.

http://aws.amazon.com/cloudformation/
New I'll end up with CloudFormation, yes
But I need to automate the upgrade of the individual AMIs used in the formation first.

The basic stack will be:

1) nginx instances behind a load balancer
2) internal load balancer to Django instances in a private VPC
3) RDS MySQL (gah) in a multi-AA with read replica configuration, in the private VPC
4) ElastiCache, probably about 7 micros to start with, in the private VPC. It's cheaper, more resilient, and more efficient to use a bunch of micros instead of the larger instances.
5) Route 53 for DNS
6) S3 for media storage
7) CloudFront for CDN and media security (signed URLs)

Once things get rolling I'll start using Dynamo and queueing. Had I known that these reference architectures would be available at the start of the project I would have designed it differently to begin with. Oh well.

Thanks.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: I'll end up with CloudFormation, yes
Sounds like you have it figured. As long as you can get the thing to auto build when stuff comes online you're golden. No more hand building servers.
New hmm, must be getting old
everything downstream of /foo
newbuild foo.tarball
stage all newbuilds in /tmp on every server via a global push
in mtc window, globally mv /foo/target /foo/target.$DATE
globally mv /tmp/foo.tarball /foo
tar xvf foo.tarball
globally or rolling restart foo.app

how is it done nowadays?
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 58 years. meep
New The problem is IP address
In AWS a new instance will come up with a different IP then it had before, unless you're using VPC and managing IP addresses manually (or scripted preferably).

But instead of doing a bunch of autodiscovery crap and copying tarballs everywhere, just change the underlying instance image once, run your deploy tests on that maintenance image, and then simply restart all the active VMs to get the new stuff.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
Expand Edited by malraux May 4, 2013, 02:08:41 PM EDT
New this stuff?
http://aws.amazon.com/console/
looks way better that the crapaud large telco cloud hosting service uses.
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 58 years. meep
New Yep.
The nice thing about AWS is that everything in that console can be scripted with your choice of language, too.

Most (if not all) of the major configuration management tools support AWS out of the box as well.

They have a free account level that provides a single instance, DB, load balancer, pretty much everything in the product catalog free for a year if you feel like playing around with it.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New might do that, thanks
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 58 years. meep
New Re: The problem is IP address
Yep - most requested feature at REINVENT was ability to assign elastic IP to load balancer.

That would simplify a LOT of stuff.
New Re: So using AWS directly via AJAX?
RE; DJango - I mucked with it for about six months a couple years ago and found it to be kind of like wordpress. I couldn't get any traction in it.

RE: PhoneGap

You're thinking about it wrong. Its just a bridge technology from html to native code. Learn to write your own plugins - they are very easy. Don't like the media controls? Write your own. I think Privix stands as a pretty good example of just how far HTML/CSS/JS apps have come. I can write them faster and better looking than native code now.

The Oakland As parking app uses a bluetooth printer made by Zebra that has a CC reader on it. There is a busted assed Java api for it (that I decompiled and fixed) and then I wrote a Phonegap plugin to access it. This is MUCH LESS work that writing a whole native app and you get Android and iOS at the same time (except for the plugin code which you have to rewrite - this is a small amount of work). I was lucky the ZXing barcode reader plugin worked already but you shouldn't hesitate to write your own plugs.
New Re: So using AWS directly via AJAX?
RE; DJango - I mucked with it for about six months a couple years ago and found it to be kind of like wordpress. I couldn't get any traction in it.

Things change a lot in a couple of years. I've built entire mobile backend websites with nary an HTML page over the space of a day or two using Django, complete with admin interface.

You're thinking about it wrong. Its just a bridge technology from html to native code. Learn to write your own plugins - they are very easy.

That's certainly an option. Android 2.x is probably going to suck with Phonegap no matter what though.

We've had some issues with media queries and such on the phones too, but I assume that's all surmountable too.

I'll definitely check it out more though, thanks.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: So using AWS directly via AJAX?
Android 2.x sucks. No doubt. The scroll performance in the browser is crap - no hardware acceleration. It barely works for my cash register app - but it does work. I avoid scrolling in it though.

OTOH, Icecream Sandwich is kind of the standard - the scrolling is still weak (heck the graphics are weak overall) but not insurmountable.

I honestly don't know why people buy those things. They suck compared to an iPhone. But I do like the open nature of them for custom device development.

New Android is a boil on my bottom
While ICS and Jelly Bean are definitely better, the unfortunate fact is that almost half of the Android devices out there are still running 2.x, which doesn't bode well for writing and distributing Android apps strictly in HTML/CSS/Javascript. That figure likely doesn't take into account Kindle Fire's, either, since it's drawn from Play store statistics.

Speaking of which, I'm also tired of dealing with all of the different store APIs and notification platforms on Android.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Re: Android is a boil on my bottom
You may well find that the native code doesn't perform much better. I have taken a run at the fence with native code on Android for a different app - I wasn't any happier with the native version and it was harder to write.

I haven't quite figured out the store thing apart from Google and Amazon. OTOH, you can just stick a link to an apk file on a web page and people can install that way. Our app is free (for now) so we aren't too worried about it. I think we will just do Google Play and Amazon and a link on our website - at least at first.

I belong to the mobile apps group on linked in and a recent poll asked people which platform they preferred and the overwhelming response was iOS because those people are fine with spending money where the Android crowd is a bunch of cheap bastards that just pirate your stuff anyhow.

Also - the level of malware on Anrdoid is pretty high.
New Re: Android is a boil on my bottom
I am unsurprised at that reaction. We saw an order of magnitude more sales in the Apple store over Play, Amazon, and NOOK combined.

I don't have the patience for the Android stuff as a user. I don't feel the need to upgrade my phone by hand or tune the OS at all.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
     My latest project - (TB D) - (20)
         So using AWS directly via AJAX? - (malraux) - (19)
             Re: So using AWS directly via AJAX? - (TB D) - (12)
                 Re: So using AWS directly via AJAX? - (malraux) - (11)
                     Re: So using AWS directly via AJAX? - (TB D) - (10)
                         Re: So using AWS directly via AJAX? - (malraux) - (9)
                             Re: So using AWS directly via AJAX? - (TB D) - (8)
                                 I'll end up with CloudFormation, yes - (malraux) - (7)
                                     Re: I'll end up with CloudFormation, yes - (TB D) - (6)
                                         hmm, must be getting old - (boxley) - (5)
                                             The problem is IP address - (malraux) - (4)
                                                 this stuff? - (boxley) - (2)
                                                     Yep. - (malraux) - (1)
                                                         might do that, thanks -NT - (boxley)
                                                 Re: The problem is IP address - (TB D)
             Re: So using AWS directly via AJAX? - (TB D) - (5)
                 Re: So using AWS directly via AJAX? - (malraux) - (4)
                     Re: So using AWS directly via AJAX? - (TB D) - (3)
                         Android is a boil on my bottom - (malraux) - (2)
                             Re: Android is a boil on my bottom - (TB D) - (1)
                                 Re: Android is a boil on my bottom - (malraux)

Yeeaaahhhh! I'm the mae-stro!
155 ms