redefining the way consumers and businesses buy wireless services through leading product and service innovation. ▪ NASDAQ traded public company – TMUS ▪ Two flagship brands: T-Mobile and MetroPCS ▪ Based in Bellevue, Washington
not reliable in modern cloud/microservices based architectures • Does not confirm to 12 factor App methodology • Specifically #6 which states Twelve- factor processes are stateless and share-nothing. Any data that needs to persist must be stored in a stateful backing service, typically a database.
managing user’s session • Redis, JDBC, Mongo, Gemfire, Hazelcast • Roll your own implementation • Supports clustered sessions without being tied to application container specific solution • SessionIDs can be exchanged via Headers to work with REST APIs • Websocket support
fast access to data • Data can be persisted to disk • Written in C • Variety of Redis client implementations exist for various programming languages • Deploy in master/slave or cluster mode for HA and scale
Useful System Metrics Metric Comments Alert? CPU Usage High CPU usage is not a bad thing as long as you don’t max out Alert triggered when threshold is reached Memory Usage Dependent on how many keys and values. OS needs memory too Alert triggered when threshold is reached Network Bandwidth Related to number of connections and size of those request. Helps with troubleshooting Disk Usage If you are persisting to disk ensure enough space left for new data, logs, temp files, snapshots or backups Alert triggered when threshold is reached
Number of clients connected to REDIS. For session data this would be number of active sessions rdb_last_save_time Timestamp when data was last persisted to disk Alert when it doesn’t meet your acceptable timeframe rdb_changes_since_last_save Number of changes to the db since it was last persisted. Data that you would lose upon restart. connected_slaves Number of slaves connected to master Alert when connected slaves is not equal to number of slaves in cluster master_last_io_seconds_ago Seconds since last interaction between slave and master Alert when it doesn’t meet your acceptable timeframe evicted_keys Number of keys removed due to reaching memory limit blocked_clients Clients blocked while waiting on BLPOP, BRPOP, or BRPOPLPUSH rejected_connections Number of connections rejected due to hitting max client limit Alert when it exceeds acceptable threshold
Avg. time taken to respond to query Alert when > 200ms or when it doesn’t meet your acceptable criteria used_memory Memory consumed by REDIS. mem_fragmentation_ratio High ratio will lead to memory swapping and perf degradation Alert when greater than 1.5 instantaneous_ops_per_sec Commands processed per second hit rate keyspace_hits / (keyspace_hits + keyspace_misses)
data • Combine cache and session store use cases • Expire/Kill user sessions • Easily Identify number of active users in the system • Works very well in clustered environment • No need for LB sticky sessions • Scales well • Performance
as a single web system for stores, dealers and call centers • Major design patterns • Complements and simplifies existing front ends • Maximum Reusability • Ability to support Metro Mobility, Metro WEB and Dealers systems as part of the platform modernization • Innovative and creative - new technologies, looking ahead and addressing clients needs (Industry is going digital) • Cloud ready • System design is based on production-proven solutions by Spring and Netflix
existing customers • Externalized Tomcat Http Session state to Redis • Increased performance due to better web server resource utilization • Eliminate LB sticky sessions • Easily swap the session data persistence store in future
• Use connection pooling • Set max-active to at-least the number of tomcat connections to redis • set max-wait configuration property to an appropriate value • Redis connection time out • spring.redis.timeout -> set appropriate value • Expired sessions cleanup • Consider cluster mode deployment with sharding to distribute data across multiple nodes Things to consider for Production