News for hackers. Stuff that matters.
Re:AWS mistakes to avoid by alttab on Saturday December 26, 2015 @02:58PM (#10795053)
Also, dont use Dynamo unless you have a really good reason. "It scales better than MySQL" is not a good reason.

Have fun migrating data and re-indexing constantly!

Re:AWS mistakes to avoid by greenleafjacob on Saturday December 26, 2015 @03:59PM (#10795286)
Is local secondary indices and lower operational costs than Cassandra a good reason(s)?
Re:AWS mistakes to avoid by wsh91 on Sunday December 27, 2015 @05:49PM (#10799027)
Operational costs are in the eye of the beholder. We evaluated DynamoDB for a new use case but we're going with Cassandra because the storage costs alone more than made up for ops overhead. At least IMO, Cassandra's support for multicolumn range queries (via clustering columns) and the cheaper storage you can use obviate local secondary indices. (Cassandra has secondary indices as well but it seems like most folks prefer further denormalization--at least, that's what we're doing.)
Re:AWS mistakes to avoid by Rapzid on Saturday December 26, 2015 @07:41PM (#10795900)
Not without considering the throttling you will hit if you exceed provisioned IOPS. You really want to consider all the angles on dynamoDB before committing to it; limitations, unique benefits, interface, etc.
Re:AWS mistakes to avoid by chucky_z on Saturday December 26, 2015 @11:04PM (#10796357)
What about as a kind of Redis stand-in? I'm curious about the DynamoDB PHP session driver.

It sounds like you have a lot of experience with Dynamo. All the use-cases I seem to keep coming up with are more for storing global environment keys outside of the environment itself and using a large number of IAM roles to access individual keys, and as a kind of throwaway 'I need to store this somewhere, but it doesn't really fit in the main DB, and I still need it to persist for at least awhile' case.

Re:AWS mistakes to avoid by kelnos on Sunday December 27, 2015 @06:51AM (#10797177)
Not the grandparent, but I have a lot of experience with DynamoDB as well. I migrated a self-managed, sharded redis store to DDB close to a year ago, and what it really depends on are your read and write patterns, and whether or not you can live with the opacity of what DDB is doing behind the scenes.

An example: if you provision X capacity units, you're actually provisioning X/N capacity units per partition. AWS is mostly transparent (via documentation) about when a table splits into a new partition (I say "mostly" because I was told by AWS that the numbers in the docs aren't quite right), but you'll have no idea how the keys are hashed between partitions, and you won't know if you have a hot partition that's getting slammed because your keys aren't well-distributed. Well, no, I take that back -- you will know, because you'll get throttled even though you're not consuming anywhere near the capacity you've provisioned. You just won't know how to fix it without a lot of trial and error (which isn't great in a production system). If your r/w usage isn't consistent, you'll either have periods of throttling, or you'll have to over-provision and waste money. There's no auto-scaling like you can do with EC2.

Not trying to knock the product: still using DDB... but getting it to a point where I felt reasonably confident about it took way longer than managing my own data store... and then they had a 6-hour outage one early, early Sunday morning a couple months ago. Possibly solution: dual-writes to two AWS regions at once and the ability to auto-pivot reads to the backup region. Which of course doubles provisioning costs.

Ok, maybe I'm knocking it a little. It's a good product, but there are definitely tradeoffs.

Re:AWS mistakes to avoid by boomzilla on Sunday December 27, 2015 @04:21PM (#10798800)
You should put some effort on designing the key schema, especially the hash key. Don't do timestamp, or sequence. I had to do a 'encrypted' key schema on my sequence IDs so sequential records are spread into different partitions. Actually it worked out well as I can exposed these encrypted keys externally too.

Agreed that DDB documentation could be better on the best practices. I found this deep dive youtube video very helpful: https://www.youtube.com/watch?v=VuKu23oZp9Q

Re:AWS mistakes to avoid by kelnos on Sunday December 27, 2015 @09:34PM (#10799563)
Oh, absolutely. The problem is that your key schema also ties you to what kind of queries you can do efficiently. My primary keys actually are very well-distributed across the hash space, but in my initial implementation, one of the global secondary indexes had a key that caused throttling and absolutely destroyed performance. Dropping that index meant losing the ability to do an entire class of queries. In this case, we were (sorta) able to live with that, but I can imagine many cases where that's a problem.

That's actually another instance of the lack of transparency and trial-and-error: "oh hey, writes are getting throttled... no idea why... let's drop this index and see if it helps".

Re:AWS mistakes to avoid by chucky_z on Sunday December 27, 2015 @10:07AM (#10797598)
Was the ElastiCache service around when you migrated Redis to Dynamo? This is another alternative I'm considering.
Re:AWS mistakes to avoid by kelnos on Sunday December 27, 2015 @09:37PM (#10799571)
The problem with ElastiCache -- and why I rejected it as an option -- as that they make you define a 30-minute "maintenance window" where AWS can apply patches and reboot your cache instances. In practice I've heard that this happens rarely, and when it does, the downtime is short, but it can in theory cause longer outages.

And in the case of both the redis and memcached backends, if the maintenance requires restarting redis/memcached or rebooting the instance, you lose all data in the cache (at least up until your last backup). For this particular project, that amount of downtime would easily cause a real outage for customers, and was unacceptable.

Re:AWS mistakes to avoid by ap22213 on Monday December 28, 2015 @02:49AM (#10800321)
I use Dynamo because I'm lazy. Need some JSON fast? 3 lines and no worries.

        DynamoDB db = new DynamoDB(new AmazonDynamoDBClient());
        Table myTable = db.getTable("table");
        Item myItem = myTable.getItem("id", id);
Sure, I don't use it for a lot of things, but for cross-VPC / cross-account configuration, it's pretty nice.
Re:AWS mistakes to avoid by joshuahornby on Saturday December 26, 2015 @06:44PM (#10795729)
Can you explain these comments? I am currently developing a system using Dyanmo as the database, I need a JSON like structure as the documents need to be flexible as different documents will contain different keys. So I am interested to hear why you think Dyanmo is a bad choice.
Re:AWS mistakes to avoid by dexterdog on Saturday December 26, 2015 @03:25PM (#10795155)
Can you expand on your last statement?
Re:AWS mistakes to avoid by markism on Saturday December 26, 2015 @03:13PM (#10795111)
Beginner here, how do you keep the database available to multiple instances without Dynamo?
Re:AWS mistakes to avoid by jdimov9 on Saturday December 26, 2015 @03:21PM (#10795137)
Use RDS.