This document summarizes a microservices meetup hosted by @mosa_siru. Key points include:
1. @mosa_siru is an engineer at DeNA and CTO of Gunosy.
2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway.
3. Challenges discussed were managing 30 microservices, ensuring API latency below 50ms across availability zones, and handling 10 requests per second with nginx load balancing across 20 servers.
unassert - encourage reliable programming by writing assertions in productionTakuto Wada
unassert - Encourage Design by Contract (DbC) by writing assertions in production code, and compiling them away from release.
Takuto Wada
2015/11/07 @nodefest Tokkyo 2015
This document summarizes Takuto Wada's presentation on reviewing RESTful web apps. It discusses best practices for designing RESTful resources and representations, including using nouns instead of verbs in URLs, making URLs reflect the meaning of resources, and ensuring resources are connected through hypermedia links and forms. It also covers appropriate use of HTTP methods, status codes, and content negotiation to build RESTful APIs in accordance with best practices.
The document describes a WordFilter class that can detect and censor sensitive words in strings. It allows specifying words to censor, and will replace matches with <censored> in the censor method output or return true/false from the detect method. The filter is designed to find and obscure matches without disturbing surrounding context.
18. package javaja;
public class Defensive {
private UserRepository userRepository;
public Defensive(UserRepository userRepository) {
this.userRepository = userRepository;
}
public User createUser(String name, int age) {
if (name == null) {
throw new NullPointerException("name is null");
}
if (age < 0) {
throw new IllegalArgumentException("age is negative");
}
if (name.isEmpty()) {
throw new IllegalArgumentException("name is empty");
}
User user = this.userRepository.create(name, age);
return user;
}
}
12年6月28日木曜日
19. package javaja;
public class UserRepository {
public User create(String name, int age) {
if (name == null) {
throw new NullPointerException("name is null");
}
if (age < 0) {
throw new IllegalArgumentException("age is negative");
}
if (name.isEmpty()) {
throw new IllegalArgumentException("name is empty");
}
return new User(name, age);
}
}
12年6月28日木曜日