AWS Weekly 2016 #24

Monday, June 13Cloud Academy explained Everything You Ever Wanted to Know about Amazon Kinesis Firehose.Tuesday, June 14AWS SES Blog announced Amazon SES Now Supports Email Headers in Notifications.AWS announced More Details from Service Last Accessed Data.AWS announced AWS Config offers a new rule for assessing license compliance.AWS announced New Edge Location in New Delhi, India for Amazon CloudFront and Amazon Route 53.Server Density Blog wrote about How Spotify and GOV.UK handle on call, and more.Wednesday, June 15AWS announced Standardized Architecture for NIST High-Impact Controls on AWS Featuring Trend Micro Deep Security.AWS announced New AWS Public Data Set - IRS 990 Filing Data.AWS announced AWS CodeDeploy Available in Asia Pacific (Seoul) Region.AWS announced Amazon RDS for PostgreSQL now supports cross-region read replicas.Cloud Academy blogged about How to Deploy Apache Storm on AWS with Storm-Deploy.Thursday, June 16AWS announced New Amazon EC2 Spot Console Now Supports Spot Fleet and Spot BlocksAWS announced Amazon CloudWatch Events Available in the South America (São Paulo) and Asia Pacific (Seoul) RegionsTrek10 wrote about Serverless Secrets.Friday, June 17AWS announced Oracle Repository Creation Utility (RCU) and April PSU Patches are now available for Amazon RDS for Oracle.Is anything missing? Looking forward to your feedback! @andreaswittig or andreas@widdix.de. Read more

mLab Launches Private Environments on AWS

mLab, the fully managed cloud database service featuring automated provisioning, scaling, and management of MongoDB databases, today announced the private beta of Private Environments. mLab Private Environments are virtual private networks that customers can provision to house their various database deployments hosted with mLab.Private Environments provide the security benefits of self-hosting database deployments without the headache of self-hosting. With Private Environments, customers can use all of the traditional network security best-practices and techniques for designing their application. Customers can:Isolate their database from public networks while allowing secure access to their application infrastructure.Create sophisticated network topologies to ensure least privilege access to their database deployments using CIDR ranges and AWS Security Groups.Auto-scale their application tier without having to modify database firewall rules.“As an early beta user of Private Environments, we've appreciated the added level of security it provides,” said Chris Lambert, CTO, Lyft. “The private network created by Private Environments keeps our infrastructure secure as we continue to grow, and makes it easy for our team to provision new application servers and auto-scale without needing to modify database firewall rules. We’ve been using mLab’s cloud-hosted MongoDB for several years and it has played a big role in helping Lyft scale.”The new solution is engineered to be a novel way for customers to use virtual private networks through a DBaaS provider. With Private Environments, mLab has created an isolated and self-contained solution that securely and seamlessly integrates into an existing stack as though the databases were inside a customer’s own VPC. The result is network security that is both operationally easy and flexible.mLab’s cloud database-as-a-service platform hosts over 300,000 MongoDB deployments, powering companies like Turner, Lyft, and Whole Foods Market. Private Environments is the first of several releases slated for 2016 as mLab continues to debut new cloud infrastructure capabilities.“mLab is hands-down the easiest way to run MongoDB on AWS,” said Will Shulman, CEO, mLab. “We believe that constantly managing database infrastructure isn’t something most developers should have to worry about; mLab’s platform and tools are designed to automatically provision, host, scale, monitor and backup your MongoDB databases. Private Environments is a powerful new capability that furthers mLab’s goal of providing cloud infrastructure solutions that are both simple and secure. We’re excited for developers to try it out.” Read more

How to Easily Sync Web and Mobile Experiences

Becoming a VIPImagine you just signed up for Amazon’s VIP checkout experience.  In this hypothetical experience, you can click a VIP button that allows you to shop for brand new items not yet available to normal Amazon customers.  “This is awesome!” you say to yourself, as you view the VIP item list in your laptop’s browser.But now, you have to head to the bus and go to work, but you still want to browse for items using the Amazon app.  Because Amazon uses feature flags, your mobile experience is automatically personalized to include the VIP experience.  Cool!  Now, your web and mobile experiences are synced instantly.Cross-Platform Personalization With Feature FlagsFeature flagging is a way to wrap features in conditionals (If/else statements) so that you can control the visibility of those features over time.  In other words, you can deploy a feature as ‘off’ and then turn it ‘on’ at a later time or you can gradually roll out a feature to select users.  So, imagine you feature flag the VIP checkout.  You can create a rule that says: “Any user who opts into the VIP program will get TRUE for the feature and everyone else will get FALSE.”  Those users who are assigned the TRUE variation will see the VIP feature and those who are assigned the FALSE variation will not.What is great about this method is that you can use this same feature flag to control the VIP checkout for both the web and mobile versions of an application.  Some more benefits of cross-platform feature flagging include:The ability to decide whether to release a cross-platform feature simultaneously or separately, with full control over who gets to see that feature. For example, web users might get access to a new search bar before mobile users do.Real time personalization that allows users to opt-in to new features on one platform (like mobile) and have that personalization sync with another platform (like web)Percentage rollouts that allow you to gradually release a feature to targeted users on different platforms, allowing you to assess user and performance feedback for each platformA kill switch that lets you turn off poorly performing features for web and mobile, without having to redeploySubscription plan management using feature flags to bundle cross-platform features into different tiers (ex. to create Bronze, Gold, and VIP plans).SummaryCross-platform feature flagging is an easy way to deliver personalized and synchronized user experiences across different platforms.  Overall, it is paving a way for a new genre of user experience personalization, where companies can harness real time user feedback to customize features across different platforms.  This could usher in an era where users do not have to adapt their behavior to an app… the app will adapt to them. Read more

Add Custom Functionality to a Spring Data Repository

Spring Data is pretty convenient and speeds up development, avoiding boilerplate code.However, there are cases where annotation queries are not enough for the custom functionality you might want to achieve.Therefore, Spring Data allows us to add custom methods to a Spring Data Repository.I will use the same project structure from a previous blog post.We have an entity called Employee:package com.gkatzioura.springdata.jpa.persistence.entity; import javax.persistence.*; /** * Created by gkatzioura on 6/2/16. */ @Entity @Table(name = "employee", schema="spring_data_jpa_example") public class Employee { @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.SEQUENCE) private Long id; @Column(name = "firstname") private String firstName; @Column(name = "lastname") private String lastname; @Column(name = "email") private String email; @Column(name = "age") private Integer age; @Column(name = "salary") private Integer salary; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastname() { return lastname; } public void setLastname(String lastname) { this.lastname = lastname; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Integer getSalary() { return salary; } public void setSalary(Integer salary) { this.salary = salary; } }And the Spring Data repository:package com.gkatzioura.springdata.jpa.persistence.repository; import com.gkatzioura.springdata.jpa.persistence.entity.Employee; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Created by gkatzioura on 6/2/16. */ @Repository public interface EmployeeRepository extends JpaRepository{ }Suppose that we want to add some custom SQL functionality, for example querying with a LIKE statement. This is not fully supported even in JDBC since we have to pass our variable concatenated with the character ‘%’.So what we need is a native JPA query like this one:Query query = entityManager.createNativeQuery("SELECT em.* FROM spring_data_jpa_example.employee as em " + "WHERE em.firstname LIKE ?", Employee.class); query.setParameter(1, firstName + "%");In order to add this functionality to our Spring Data Repository, we have to add an interface. It is mandatory for our interface to follow the naming convention of ${Original Repository name}Custom. Therefore, the interface describing our custom functionality should bepackage com.gkatzioura.springdata.jpa.persistence.repository; import com.gkatzioura.springdata.jpa.persistence.entity.Employee; import java.util.List; /** * Created by gkatzioura on 6/3/16. */ public interface EmployeeRepositoryCustom { List getFirstNamesLike(String firstName); }And the implementation should be:package com.gkatzioura.springdata.jpa.persistence.repository; import com.gkatzioura.springdata.jpa.persistence.entity.Employee; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; import java.util.List; /** * Created by gkatzioura on 6/3/16. */ @Repository @Transactional(readOnly = true) public class EmployeeRepositoryImpl implements EmployeeRepositoryCustom { @PersistenceContext EntityManager entityManager; @Override public List getFirstNamesLike(String firstName) { Query query = entityManager.createNativeQuery("SELECT em.* FROM spring_data_jpa_example.employee as em " + "WHERE em.firstname LIKE ?", Employee.class); query.setParameter(1, firstName + "%"); return query.getResultList(); } }And we should change our original Spring Data repository in order to inherit the custom functionality.package com.gkatzioura.springdata.jpa.persistence.repository; import com.gkatzioura.springdata.jpa.persistence.entity.Employee; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Created by gkatzioura on 6/2/16. */ @Repository public interface EmployeeRepository extends JpaRepository, EmployeeRepositoryCustom { }Seems like a nice way of composition.Now let’s add a method to a controller that will call this custom method:package com.gkatzioura.springdata.jpa.controller; import com.gkatzioura.springdata.jpa.persistence.entity.Employee; import com.gkatzioura.springdata.jpa.persistence.repository.EmployeeRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * Created by gkatzioura on 6/2/16. */ @RestController public class TestController { @Autowired private EmployeeRepository employeeRepository; @RequestMapping("/employee") public List getTest() { return employeeRepository.findAll(); } @RequestMapping("/employee/filter") public List getFiltered(String firstName) { return employeeRepository.getFirstNamesLike(firstName); } }The source code can be found on GitHub. Read more

EU cautions governments against banning Uber, Airbnb

BRUSSELS/LONDON European Union governments should not ban services like home-rental site Airbnb or ride-hailing app Uber except as a last resort, the EU says in new guidelines, seeking to rein in a crackdown on the "sharing economy".In guidelines seen by Reuters, the European Commission said any restrictions by EU member states on these new online services should be justified and proportionate to the public interest at stake."Total bans of an activity constitute a measure of last resort that should be applied only if and where no less restrictive requirements to attain a public interest can be used," the draft document says.In the case of room-renting sites like Airbnb, the Commission said banning short-term lets of apartments "appears difficult to justify" when limits on the maximum number of days apartments can be rented out would be more appropriate.The guidelines will come as good news for the likes of Uber and Airbnb, which have faced outright bans or restrictions in some cities as established industry players complain of unfair competition.Airbnb, founded in 2008, and Uber, launched a year later, both grew up in the hot-house San Francisco Internet scene and almost from the start have faced regulatory battles across the United States, and, more recently, around the world.Both have become favorite targets of local officials and rival trade groups in Europe, with its tradition of strong social oversight.In the "sharing economy", customers use the Internet to contract services such as ride-sharing, where amateur drivers displace professional taxis, or home-sharing, which reduces hotel demand. "These services can fall within several sectors, falling under the regulatory burden of all of them," the Commission said.A case in point is Uber, which considers itself merely a digital service connecting drivers and passengers as opposed to a transport service, which would make it subject to more onerous rules on driver qualifications, road rules and insurance.The EU's highest court is set to rule later this year or next on whether Uber is a transport company or a digital service. LOCAL SKIRMISHESAssociations of taxi drivers have staged high-profile protests against Uber in France, Britain, Portugal, Spain and many other European countries since 2014.Last year, French prosecutors staged a high-profile raid of Uber's Paris offices in a showdown over whether the company was violating a law to curtail online taxi services.Uber suspended its UberPOP service, which relies on non-professional drivers, in Brussels last October after a court ordered it shut down. The company reintroduced its service in Madrid in March after beating a hasty retreat from the market in 2014 following a court ruling against it.Airbnb has faced loud criticism from city officials in Barcelona and Paris over its impact on local housing markets.On May 1, Berlin officials implemented one of the world's toughest clampdowns on Airbnb. City officials have promised to reject 95 percent of requests by landlords to rent out places on a short-term basis.City officials have received more than 500 legal complaints over the murky provisions of the new law. A Berlin court on June 8 is handling the case of German Airbnb competitor Wimdu, which filed suit over the new regulation.German hotel association IHA said in response to the EU guidelines: “The current legal vacuum...comes at the expense of consumers, residents and taxpayers and distorts the competition to the (disadvantage) of the heavily regulated hotel industry.” (Additional reporting by Tina Bellon in Frankfurt, Michel Rose in Paris, Paul Day in Madrid, Toby Sterling in Amsterdam and Axel Bugge in Lisbon; editing by Adrian Croft) Read more

Older Post