Table of Contents
Below are a set of best practices that I recommend for most customers. This information is based on my experience helping hundreds of Azure Redis customers investigate various issues.
- Use Standard or Premium Tier for Production systems. The Basic Tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are really meant for simple dev/test scenarios since they have a shared CPU core, very little memory, are prone to "noisy neighbor", etc.
- Remember that Redis is an In-Memory data store. Read this article so that you are aware of scenarios where data loss can occur.
- Configure your client library to use a "connect timeout" of at least 10 to 15 seconds, giving the system time to connect even under higher CPU conditions. If your client or server tend to be under high load
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p certs | |
openssl req -x509 -days 365 -newkey rsa:4096 -nodes -sha256 -out certs/domain.crt -keyout certs/domain.key -subj "/C=DE/ST=Berlin/L=Berlin/O=IT/CN=docker.local" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Permutations { | |
public static <T> Stream<Stream<T>> of(final List<T> items) { | |
return IntStream.range(0, factorial(items.size())).mapToObj(i -> permutation(i, items).stream()); | |
} | |
private static int factorial(final int num) { | |
return IntStream.rangeClosed(2, num).reduce(1, (x, y) -> x * y); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Copy 'git-sync-fork' script code from gist | |
2. Create a file called 'git-sync-fork' in any 'bin' directory in your $PATH | |
3. Paste script into this new file 'git-sync-fork' and save | |
4. Make the file executable `chmod +x git-sync-fork` | |
5. Run the script inside your locally forked git repo | |
Example: | |
git-sync-fork upstream origin |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package enableannot.selector; | |
import org.springframework.context.annotation.Import; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Retention(RetentionPolicy.RUNTIME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ComponentScan | |
@Import(ServiceConfiguration.class) | |
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL) | |
@EnableAutoConfiguration | |
public class Application extends SpringBootServletInitializer { | |
private static Class<Application> applicationClass = Application.class; | |
public static void main(String[] args) { | |
SpringApplication.run(applicationClass); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab('org.quartz-scheduler:quartz:2.1.6') | |
@Grab('org.slf4j:slf4j-simple:1.7.1') | |
import org.quartz.* | |
import org.quartz.impl.* | |
import org.quartz.jobs.* | |
import static org.quartz.DateBuilder.* | |
import static org.quartz.JobBuilder.* | |
import static org.quartz.TriggerBuilder.* | |
import static org.quartz.CalendarIntervalScheduleBuilder.* |