in here. You WILL think - that wouldn’t have happened to me (You WILL be wrong) And you shouldn’t listen - go find things out for yourself. Don’t believe the tech hype Question everything
of scale.. Problems we solved... Scaling languages, frameworks, architectures... I want to talk about The simple, stupid, mundane problems that will bite you (and cause you to have to work the weekend)
family as it’s intended to run on Deploying Linux -> Develop on Linux (Mac is fine) Deploying on Windows -> Develop on Windows Otherwise you'll end up writing code like this if (OperatingSystem.current().isWindows()) { //lots of build script stuff } else { //lots more build script stuff } You’ll be dealing with ^M in your files Hacks to solve Windows path length limitations
Schedules to run certain things at Page headings and text Email addresses to send error notifications to Customers need to be able to change them without downtime Read often - don’t want database hits! Can’t use environment variables or System properties Solution: Use Ehcache Library already in the project - via Hibernate
monitoring isn’t there out of the box Flying blind Customise the image JMX and SSH Tunnels You can't turn off instances if you use autoscaling $ aws ec2 stop-instances --instance-ids i-de5b6d56 Customising with .ebextensions can be tricky YAML format is awkward
App Server (EC2) and Load Balancer in the same zone Can’t undo this later > Start Over! Solution: Use Cloud Formation Templates Tools to generate from existing infrastructure Temperamental Beanstalk Deployment / Rollback cycles
storage costs Our CI build pipeline was storing our binary in S3 Beanstalk keeps copies of deployed apps on S3 also We stopped storing the binary artifacts on S3 Use Git tags Rebuild from source S3 is eventually consistent
Load Customer provides data in CSV - to put in our application Using Apache Camel: from(“aws:s3://my-bucket”) .process(new MyProcessor()) .to(“sql: insert into table values (:col1, :col2, col3)?dataSource=myDb”)
Why? Too much logging can max your cpu and trigger autoscaling! Beanstalk “Freak Outs” Too little and you dont know whats going on! Customising log levels at runtime is a must - but more Beanstalk customisation! Example of how easy it is to do trivial things that cost you money! CPU logging causing an autoscale event
what it’s doing in the database Know your database. Know SQL. (Don't use Mongodb - just because you don't like SQL) def departmentCode = “SC” Student.list().each { student -> def title = Department.findByDepartmentCode(departmentCode)?.title //do something cool with the Student and department title }
for your ORM? What if your Student table has 1 million records? What if your Student/Department tables have no indexing? What if your both the Student and Department tables have 1 million records? What if you also had TRACE logging enabled?
you work for MegaCorp™ A faceless credit controller is paying for your servers! Technical choices and bad code cost money. Memory leaks CPU Usage Disk Usage
pain Requires software on customer end Scripts / Java Code Well tested - but temporary solution Nothing as permanent as a temporary solution Didn’t work when installed on customers server! Why?
What is your API versioning strategy How will you do service discovery? What protocols will your services communicate over? How will you monitor services? How will you debug your system? How will you ensure loose coupling? How will you decide which service to put functionality in? How will you communicate a change to a service? Who owns and can make changes to a service? What is your database design strategy? Who owns the documentation? How will you integrate legacy services / systems?
the future If you build X now you’re probably in over engineering territory AKA - YAGNI (You aint gonna need it) AKA - Scope Creep Speed and performance are relative You *probably* don't need 32 CPU cores for an app used by 100 people Old carpentry proverb: Measure twice, cut once
and application.groovy and resources.groovy Multiple places for configuration System properties in Beanstalk Application configuration properties in the database Solution - Refactor Regularly (Btw - its not easy)
of tools/frameworks/programming languages Don’t believe the hype! Don’t accept claims without evidence! Including everything presented here! Try stuff out yourself Go build something great. Possibly even a disruptive mesh network with microservices and IOT Good Luck.