Recent Posts
Archives

Posts Tagged ‘Microservices’

PostHeaderIcon [DevoxxUS2017] Java EE 8: Adapting to Cloud and Microservices

At DevoxxUS2017, Linda De Michiel, a pivotal figure in the Java EE architecture team and Specification Lead for the Java EE Platform at Oracle, delivered a comprehensive overview of Java EE 8’s development. With her extensive experience since 1997, Linda highlighted the platform’s evolution to embrace cloud computing and microservices, aligning with modern industry trends. Her presentation detailed updates to existing Java Specification Requests (JSRs) and introduced new ones, while also previewing plans for Java EE 9. This post explores the key themes of Linda’s talk, emphasizing Java EE 8’s role in modern enterprise development.

Evolution from Java EE 7

Linda began by reflecting on Java EE 7, which focused on HTML5 support, modernized web-tier APIs, and simplified development through Context and Dependency Injection (CDI). Building on this foundation, Java EE 8 shifts toward cloud-native and microservices architectures. Linda noted that emerging trends, such as containerized deployments and distributed systems, influenced the platform’s direction. By enhancing CDI and introducing new APIs, Java EE 8 aims to streamline development for scalable, cloud-based applications, ensuring developers can build robust systems that meet contemporary demands.

Enhancements to Core JSRs

A significant portion of Linda’s talk focused on updates to existing JSRs, including CDI 2.0, JSON Binding (JSON-B), JSON Processing (JSON-P), and JAX-RS. She announced that CDI 2.0 had unanimously passed its public review ballot, a milestone for the expert group. JSON-B and JSON-P, crucial for data interchange in modern applications, have reached proposed final draft stages, while JAX-RS enhances RESTful services with reactive programming support. Linda highlighted the open-source nature of these implementations, such as GlassFish and Jersey, encouraging community contributions to refine these APIs for enterprise use.

New APIs for Modern Challenges

Java EE 8 introduces new JSRs to address cloud and microservices requirements, notably the Security API. Linda discussed its early draft review, which aims to standardize authentication and authorization across distributed systems. Servlet and JSF updates are also progressing, with JSF nearing final release. These APIs enable developers to build secure, scalable applications suited for microservices architectures. Linda emphasized the platform’s aggressive timeline for a summer release, underscoring the community’s commitment to delivering production-ready solutions that align with industry shifts toward cloud and container technologies.

Community Engagement and Future Directions

Linda stressed the importance of community feedback, directing developers to the Java EE specification project on java.net for JSR details and user groups. She highlighted the Adopt-a-JSR program, led by advocates like Heather VanCura, as a channel for aggregating feedback to expert groups. Looking ahead, Linda briefly outlined Java EE 9’s focus on further cloud integration and modularity. By inviting contributions through open-source platforms like GlassFish, Linda encouraged developers to shape the platform’s future, ensuring Java EE remains relevant in a rapidly evolving technological landscape.

Links:

PostHeaderIcon [DevoxxUS2017] The Hardest Part of Microservices: Your Data by Christian Posta

At DevoxxUS2017, Christian Posta, a Principal Middleware Specialist at Red Hat, delivered an insightful presentation on the complexities of managing data in microservices architectures. Drawing from his extensive experience with distributed systems and open-source projects like Apache Kafka and Apache Camel, Christian explored how Domain-Driven Design (DDD) helps address data challenges. His talk, inspired by his blog post on ceposta Technology Blog, emphasized the importance of defining clear boundaries and leveraging event-driven technologies to achieve scalable, autonomous systems. This post delves into the key themes of Christian’s session, offering a comprehensive look at navigating data in microservices.

Understanding the Domain with DDD

Christian Posta began by addressing the critical need to understand the business domain when building microservices. He highlighted how DDD provides a framework for modeling complex domains by defining bounded contexts, entities, and aggregates. Using the example of a “book,” Christian illustrated how context shapes data definitions, such as distinguishing between a book as a single title versus multiple copies in a bookstore. This clarity, he argued, is essential for enterprises, where domains like insurance or finance are far more intricate than those of internet giants like Netflix. By grounding microservices in DDD, developers can create explicit boundaries that align with business needs, reducing ambiguity and fostering autonomy.

Defining Transactional Boundaries

Transitioning to transactional boundaries, Christian emphasized minimizing the scope of atomic operations to enhance scalability. He critiqued the traditional reliance on single, ACID-compliant databases, which often leads to brittle systems when applied to distributed architectures. Instead, he advocated for identifying the smallest units of business invariants, such as a single booking in a travel system, and managing them within bounded contexts. Christian’s insights, drawn from real-world projects, underscored the pitfalls of synchronous communication and the need for explicit boundaries to avoid coordination challenges like two-phase commits across services.

Event-Driven Communication with Apache Kafka

A core focus of Christian’s talk was the role of event-driven architectures in decoupling microservices. He introduced Apache Kafka as a backbone for streaming immutable events, enabling services to communicate without tight coupling. Christian explained how Kafka’s publish-subscribe model supports scalability and fault tolerance, allowing services to process events at their own pace. He highlighted practical applications, such as using Kafka to propagate changes across bounded contexts, ensuring eventual consistency while maintaining service autonomy. His demo showcased Kafka’s integration with microservices, illustrating its power in handling distributed data.

Leveraging Debezium for Data Synchronization

Christian also explored Debezium, an open-source platform for change data capture, to address historical data synchronization. He described how Debezium’s MySQL connector captures consistent snapshots and streams binlog changes to Kafka, enabling services to access past and present data. This approach, he noted, supports use cases where services need to synchronize from a specific point, such as “data from Monday.” Christian’s practical example demonstrated Debezium’s role in maintaining data integrity across distributed systems, reinforcing its value in microservices architectures.

Integrating Apache Camel for Robust Connectivity

Delving into connectivity, Christian showcased Apache Camel as a versatile integration framework for microservices. He explained how Camel facilitates communication between services by providing routing and transformation capabilities, complementing Kafka’s event streaming. Christian’s live demo illustrated Camel’s role in orchestrating data flows, ensuring seamless integration across heterogeneous systems. His experience as a committer on Camel underscored its reliability in building resilient microservices, particularly for enterprises transitioning from monolithic architectures.

Practical Implementation and Lessons Learned

Concluding, Christian presented a working example that tied together DDD, Kafka, Camel, and Debezium, demonstrating a cohesive microservices system. He emphasized the importance of explicit identity management, such as handling foreign keys across services, to maintain data integrity. Christian’s lessons, drawn from his work at Red Hat, highlighted the need for collaboration between developers and business stakeholders to refine domain models. His call to action encouraged attendees to explore these technologies and contribute to their open-source communities, fostering innovation in distributed systems.

Links:

PostHeaderIcon [DevoxxUS2017] Continuous Optimization of Microservices Using Machine Learning by Ramki Ramakrishna

At DevoxxUS2017, Ramki Ramakrishna, a Staff Engineer at Twitter, delivered a compelling session on optimizing microservices performance using machine learning. Collaborating with colleagues, Ramki shared insights from Twitter’s platform engineering efforts, focusing on Bayesian optimization to tune microservices in data centers. His talk addressed the challenges of managing complex workloads and offered a vision for automated optimization. This post explores the key themes of Ramki’s presentation, highlighting innovative approaches to performance tuning.

Challenges of Microservices Performance

Ramki Ramakrishna opened by outlining the difficulties of tuning microservices in data centers, where numerous parameters and workload variations create combinatorial complexity. Drawing from his work with Twitter’s JVM team, he explained how continuous software and hardware upgrades exacerbate performance issues, often leaving resources underutilized. Ramki’s insights set the stage for exploring machine learning as a solution to these challenges.

Bayesian Optimization in Action

Delving into technical details, Ramki introduced Bayesian optimization, a machine learning approach to automate performance tuning. He described its application in Twitter’s microservices, using tools derived from open-source projects like Spearmint. Ramki shared practical examples, demonstrating how Bayesian methods efficiently explore parameter spaces, outperforming manual tuning in scenarios with many variables, ensuring optimal resource utilization.

Lessons and Pitfalls

Ramki discussed pitfalls encountered during Twitter’s optimization projects, such as the need for expert-defined parameter ranges to guide machine learning algorithms. He highlighted the importance of collaboration between service owners and engineers to specify tuning constraints. His lessons, drawn from real-world implementations, emphasized balancing automation with human expertise to achieve reliable performance improvements.

Vision for Continuous Optimization

Concluding, Ramki outlined a vision for a continuous optimization service, integrating machine learning into DevOps pipelines. He noted plans to open-source parts of Twitter’s solution, building on frameworks like Spearmint. Ramki’s forward-thinking approach inspired developers to adopt data-driven optimization, ensuring microservices remain efficient amidst evolving data center demands.

Links:

PostHeaderIcon [DevoxxUS2017] Lessons Learned from Building Hyper-Scale Cloud Services Using Docker by Boris Scholl

At DevoxxUS2017, Boris Scholl, Vice President of Development for Microservices at Oracle, shared valuable lessons from building hyper-scale cloud services using Docker. With a background in Microsoft’s Service Fabric and Container Service, Boris discussed Oracle’s adoption of Docker, Mesos/Marathon, and Kubernetes for resource-efficient, multi-tenant services. His session offered insights into architecture choices and DevOps best practices, providing a roadmap for scalable cloud development. This post examines the key themes of Boris’s presentation, highlighting practical strategies for modern cloud services.

Adopting Docker for Scalability

Boris Scholl began by outlining Oracle’s shift toward cloud services, leveraging Docker to build scalable, multi-tenant applications. He explained how Docker containers optimize resource consumption, enabling rapid service deployment. Drawing from his experience at Oracle, Boris highlighted the pros of containerization, such as portability, and cons, like the need for robust orchestration, setting the stage for discussing advanced DevOps practices.

Orchestration with Mesos and Kubernetes

Delving into orchestration, Boris discussed Oracle’s use of Mesos/Marathon and Kubernetes to manage containerized services. He shared lessons learned, such as the importance of abstracting container management to avoid platform lock-in. Boris’s examples illustrated how orchestration tools ensure resilience and scalability, enabling Oracle to handle hyper-scale workloads while maintaining service reliability.

DevOps Best Practices for Resilience

Boris emphasized the critical role of DevOps in running “always-on” services. He advocated for governance to manage diverse team contributions, preventing architectural chaos. His insights included automating CI/CD pipelines and prioritizing diagnostics for monitoring. Boris shared a lesson on avoiding over-reliance on specific orchestrators, suggesting abstraction layers to ease transitions between platforms like Mesos and Kubernetes.

Governance and Future-Proofing

Concluding, Boris stressed the importance of governance in distributed systems, drawing from Oracle’s experience in maintaining component versioning and compatibility. He recommended blogging as a way to share microservices insights, referencing his own posts. His practical advice inspired developers to adopt disciplined DevOps practices, ensuring cloud services remain scalable, resilient, and adaptable to future needs.

Links:

PostHeaderIcon [ScalaDaysNewYork2016] Lightbend Lagom: Crafting Microservices with Precision

Microservices have become a cornerstone of modern software architecture, yet their complexity often poses challenges. At Scala Days New York 2016, Mirco Dotta, a software engineer at Lightbend, introduced Lagom, an open-source framework designed to simplify the creation of reactive microservices. Mirco showcased how Lagom, meaning “just right” in Swedish, balances developer productivity with adherence to reactive principles, offering a seamless experience from development to production.

The Philosophy of Lagom

Mirco emphasized that Lagom prioritizes appropriately sized services over the “micro” aspect of microservices. By focusing on clear boundaries and isolation, Lagom ensures services are neither too small nor overly complex, aligning with the Swedish concept of sufficiency. Built on Play Framework and Akka, Lagom is inherently asynchronous and non-blocking, promoting scalability and resilience. Mirco highlighted its opinionated approach, which standardizes service structures to enhance consistency across teams, allowing developers to focus on domain logic rather than infrastructure.

Development Environment Efficiency

Lagom’s development environment, inspired by Play Framework, is a standout feature. Mirco demonstrated this with a sample application called Cheerer, a Twitter-like service. Using a single SBT command, runAll, developers can launch all services, including an embedded Cassandra server, service locator, and gateway, within one JVM. The environment supports hot reloading, automatically recompiling and restarting services upon code changes. This streamlined setup, consistent across different machines, frees developers from managing complex scripts, enhancing productivity and collaboration.

Service and Persistence APIs

Lagom’s service API is defined through a descriptor method, specifying endpoints and metadata for inter-service communication. Mirco showcased a “Hello World” service, illustrating how services expose endpoints that other services can call, facilitated by the service locator. For persistence, Lagom defaults to Cassandra, leveraging its scalability and resilience, but allows flexibility for other data stores. Mirco advocated for event sourcing and CQRS (Command Query Responsibility Segregation), noting their suitability for microservices. These patterns enable immutable event logs and optimized read views, simplifying data management and scalability.

Production-Ready Features

Transitioning to production is seamless with Lagom, as Mirco demonstrated through its integration with SBT Native Packager, supporting formats like Docker images and RPMs. Lightbend Conductor, available for free in development, simplifies orchestration, offering features like rolling upgrades and circuit breakers for fault tolerance. Mirco highlighted ongoing work to support other orchestration tools like Kubernetes, encouraging community contributions to expand Lagom’s ecosystem. Circuit breakers and monitoring capabilities further ensure service reliability in production environments.

Links:

PostHeaderIcon [DevoxxFR2015] Reactive Applications on Raspberry Pi: A Microservices Adventure

Alexandre Delègue and Mathieu Ancelin, both engineers at SERLI, captivated attendees at Devoxx France 2015 with a deep dive into building reactive applications on a Raspberry Pi cluster. Leveraging their expertise in Java, Java EE, and open-source projects, they demonstrated a microservices-based system using Play, Akka, Cassandra, and Elasticsearch, testing the Reactive Manifesto’s promises on constrained hardware.

Embracing the Reactive Manifesto

Alexandre opened by contrasting monolithic enterprise stacks with the modular, scalable approach of the Reactive Manifesto. He introduced their application, built with microservices and event sourcing, designed to be responsive, resilient, and elastic. Running this on Raspberry Pi’s limited resources tested the architecture’s ability to deliver under constraints, proving its adaptability.

This philosophy, Alexandre noted, prioritizes agility and resilience.

Microservices and Event Sourcing

Mathieu detailed the application’s architecture, using Play for the web framework and Akka for actor-based concurrency. Cassandra handled data persistence, while Elasticsearch enabled fast search capabilities. Event sourcing ensured a reliable audit trail, capturing state changes as events. The duo’s live demo showcased these components interacting seamlessly, even on low-powered Raspberry Pi hardware.

This setup, Mathieu emphasized, ensures robust performance.

Challenges of Clustering on Raspberry Pi

The session highlighted configuration pitfalls encountered during clustering. Alexandre shared how initial deployments overwhelmed the Raspberry Pi’s CPU, causing nodes to disconnect and form sub-clusters. Proper configuration, tested pre-production, resolved these issues, ensuring stable heartbeats across the cluster. Their experience underscored the importance of thorough setup validation.

These lessons, Alexandre noted, are critical for constrained environments.

Alternative Reactive Approaches

Mathieu explored other reactive libraries, such as Spring Boot with reactive Java 8 features and async servlets, demonstrating versatility beyond Akka. Their demo included Gatling for load testing, though an outdated plugin caused challenges, since resolved natively. The session concluded with a nod to the fun of building such systems, encouraging experimentation.

This flexibility, Mathieu concluded, broadens reactive development options.

Links: