AWS Serverless React Native Starter App
github.com
github.com
Also, user "nslog" only posts Amazon stuff and never comments.
I would argue that real infrastructure or vendor "lock in" is due to the friction of learning the API's associated with each cloud platform. Obviously, one can choose to use all the services of the cloud platform they will deploy to. However, and in most cases, that is not a strict requirement to use the cloud platform to begin with. "Lock in" seems more like a self-created problem than anything.
And it's not just cloud platforms. Every tool you use becomes more engrained the more you use it.
Put plainly: It seems silly to me how people will shout "vendor lock-in" when using a service like DynamoDB or Kinesis, but will be more than happy to learn how to set up and maintain a Cassandra or Kafka cluster, along with Zookeeper, Puppet/Chef, and all that goes along with it. Those are not insignificant costs!
I get that those aren't vendor-specific, but at some point you're just doing a lot more work, maintenance, and tying yourself down to a stack (and whatever employees became experts in them), and for what benefit? So you'll theoretically be able to move away faster if AWS goes rogue, long after your startup gains traction?
I think those reflexively dismissing cloud services due to vendor lock-in need to take a step back and look at the big picture.
Costs are high for aws. You might be able to pay a little more now but when you need to scale you may find you are priced off of aws.
More importantly, though: you quite possibly won't ever find yourself "priced off of aws." Netflix isn't. Workday isn't. Spotify isn't. Pinterest isn't. Dropbox only transitioned off very recently (reportedly for more control). Some of the biggest players on the web were able to scale and grow beyond most of our wildest dreams without it holding them back, yet still some recommend adding significant man-hours and complexity up-front just on the off-chance it becomes necessary after it's successful?
Let's be realistic here.
Yeah, their server software itself sucks a bit (low tick-rate, odd "de-sync"), but scaling itself has not been any issue: it feels the same now as it did with a tenth or a hundredth of the players it has right now.
Compare that to the growing pains that, for example, league of legends had, where even several years in the whole of EUW would be practically down on weekends. (log in "queue" over 9000)
The cost calculus doesn't usually switch until you've pretty far along on solving those things.
But otherwise I agree, vendor lock in seems out of control.
If you have some product-market fit, vendor lock-in probably doesn't matter.
If your business is growing quickly and you have the ability to raise a strong Series A investment (if you wanted to), then vendor relationships are worth thinking about and engineering for the long term.
Giants like Amazon, Facebook, and Google don't want to "control your stuff before you even make it" because most things that people make aren't worth their time. Once your business is growing steadily, however, this might change.
The only goal that matters for an early stage startup is product/market fit. If you can demonstrate traction you can raise money to buy yourself more time.
For this, rapid iteration is critical. Use whatever tools help; vendor lock-in is something you solve when you have 20mm+ in the bank.
Hiring will be a pain, especially if you are competing with giants or millions of dollar valuation startups. One less person you have to hire is eons you can spend on other things.
Sales/Marketing would suck, you would spend more on getting the deal then you will make from that in 2 years. Your first 10 ideas to make the app viral will fail. Your dev time not going in ops. can be used to squeeze in that feature, the big fat wallet is asking for.
Don't worry about vendor lockin, React patents, green earth. 90% chance you'll die before you hit that, make that 99% if you are worrying about that. You'll anyway rewrite/rearch. the thing you are writing, as your understanding of market will improve.
I fully acknowledge that there are resources or options that I could be totally missing. If there is anyone who has gone through this sort of thing and has successfully managed to get really transparent look at pricing and reliably and easily shut down/provision/cap AWS services, do let me know!
You can set billing alerts that will e-mail you when you cross whatever thresholds you set. On the billing page, it has a line item for each thing that costs money. It's not particularly difficult to stop anything, especially when you're just doing hobby projects anyway.
If you're OK with insignificant (less than $10) charges on your credit card, it's really not that hard to get pretty far with serverless. Almost everything serverless has perpetual free tiers and the ones that don't (API Gateway, CloudFront, Route 53) have very low usage-based costs (less than $1/mo idle). If you put any value at all on your time, you'd cross these amounts almost immediately trying to setup / learn anything else.
I'm suffering from the AWS billing madness too, and trying to understand if others share some of the same issues I've seen. Could I contact you to hear more about your billing frustrations?
That being said, turn off the EC2 instances and there is rarely an ongoing trickle of costs, as the other services mostly are billed on how much they are invoked, which is good for hobby projects.
The one technology I particularly like is Cognito/UserPools for user management - I never want to write Yet Another User Management System again.
I'd never use DynamoDB though - it's never made sense to me.
* AWS Userpools
* AWS Cognito
* AWS S3 Simple Storage Service
* AWS EC2 Elastic Compute Cloud
* AWS SQS Simple Queue Service
* AWS CloudFront
* AWS CloudWatch
* AWS KMS Key Management Service
* AWS Certificate Management Service
* AWS Route53
* AWS Lambda
* Postgres/SQL
* Python 3.6
* ReactJS/ES2015
DynamoDB has world-class horizontal scalability but certainly comes with a high architecture integration cost, depending on your use cases.
context.callbackWaitsForEmptyEventLoop = false;
I only came across this last night, so haven't had a chance to test yet. Supposedly reduces the cold-start VPC delay significantly.If cloud providers want to be seen like utility providers, they need to provide a simple pricing model analogous to Watt and kWh in electricity for users to be able to estimate costs easily.
I have several mobile apps that I run literaly free because the Lambda usage is under the free tier and those I don't cost dollars a month. I am very happy with it in general.
There is of course the problem with any instant scaling metered service that if you are actively attacked you can rack up a large bill but there are monitoring systems that can be used to prevent that if you want (at the cost of taking down the service) or allow it to scale (at the cost of $$ but your customers stay happy).
Edit: It is worth noting (based on discussion below) that other posters are right. It is not for everyone. It has some major tradeoffs that you need to be aware of and plan around. But if the tradeoffs are OK (and I personally found they are for many of my projects) it is a great service.
Use DynamoDB if you are absolutely sure your database structure is perfectly optimized from the get go for the traffic you're going to receive. Your indexes and structure have to be absolutely perfect starting, because there's no good way to fix them later.
1. I agree. First few attempts at DynamoDB tables were a disaster. But once you get used to them you don't have to change schemas and then it is not an issue. Note, you can add and indexes, just not the primary one.
2. Not so. It's not easy but it's far from impossible or painful. I've had my fair share of pain migrating SQL databases too.
... Export to S3
... Grab the S3 backup and write an ETL to format and load it
... Put in place a stream hook to keep your newly loaded database up to date
... Switch over your data abstraction / model layer (you did use one of those right?)
3. You can also choose your indexes wisely. How is this different than a normal database?
Most of my DynamoDB using apps I run for 100% free and I've scaled to hundreds of thousands of users for less than the cost of a small Postgres server.
Just keep a model layer between you and Dynamo to avoid vendor lockin and you'll be fine.
You can also use Amazon RDS with Lambda which, while still a database "server" does not require you to manage the server yourself.
As a compromise I'd look to using MySQL or Postgres as a backend, and that being the only server I'm running, so that it's easier to move later (and so I still have access to a relational database). Except Lambda cold starts in a VPC are horrid, with no sign of change.
If you haven't looked into Lambda cold start problems, you're in for a treat. The main pitch for Lambda is for little utilized services, or services that need to scale fast, right? And in this example, you're using it to power an API? Imagine if the service is lightly used, whenever a user goes to hit the API for the first time, it takes 15 seconds to respond. Or worse, imagine if the service is getting popular, users get subjected to 15+ second response times every time Lambda has to start a new instance.
Although I did try to address some of your concerns in a reply to your other post.
What the heck are you doing for 15 second cold starts? I haven't seen more than a 1s overhead for cold starts with Node.js apps packed with webpack (more like 2 or 3s without webpack)
But yes, if the cold start time is unacceptable to you. Lambda is a terrible fit. But you have to ask yourself what is and is not acceptable. Especially in a mobile or single page app where you can eager load or do background requests.
It is not for everyone.
Another trick is to group similar functions together in the same code and have different API gateway endpoints go to the same Lambda. Using that method most apps I've made have less than 1% of requests hit a cold start situation.
Edit: for many apps 1% sold starts is unacceptable. And that's OK. Lambda isn't for you.
I'm thinking about working on a solution to better understand and limit costs in AWS. Could I contact you to understand a bit more about what would be an ideal setup for you?
God forbid someone doesn't get a corporation's branding 100% correct. Correcting them seems petty and doesn't elevate the convo.
Also, is there any way to run something like DynamoDB locally to run tests against?
Perhaps you would need to make a separate test instance of the DynamoDB on AWS to run tests against? This would be less than ideal due to latency.