Showing posts with label #amazon #AmazonAWS #AmazonWebServices #Alexa #AlexaUpdates #AmazonEcho. Show all posts
Showing posts with label #amazon #AmazonAWS #AmazonWebServices #Alexa #AlexaUpdates #AmazonEcho. Show all posts

Monday, June 15, 2020

An Introduction To Kafka Architecture and Kafka as a Service

Kafka and Kafka as a Service

Apache Kafka is a fast and scalable Publish/Subscribe messaging platform. It enables the communication between producers and consumers using messaging-based topics. It allows producers to write records into Kafka that can be read by one or more consumers per consumer group. It's becoming a solution for big data and microservices applications. It is being used by several companies to solve the problem of real-time processing.

A Broker is like a Kafka server that runs in a Kafka Cluster. Kafka Brokers form a cluster. The Kafka Cluster consists of many Kafka Brokers on several servers. Brokers often refer to more of a logical system or as Kafka as a whole.

It uses ZooKeeper to manage the cluster. ZooKeeper is used to coordinate the brokers/cluster topology. ZooKeeper gets used for leadership elections for Broker Topic Partition Leaders.

The Kafka architecture consists of four main APIs on which Kafka runs.
  1. Producer API:
This API allows an application to publish a stream of records to one or more Kafka topics.

Consumer API

It allows an application to subscribe to one or more topics. It also allows the application to process the stream of records that are published to the topic(s).

Streams API

This streams API allows an application to act as a stream processor. The application consumes an input stream from one or more topics and produces an output stream to one or more output topics thereby transforming input streams to output streams.

Connector API

This connector API builds reusable producers and consumers that connect Kafka topics to applications and data systems.

Kafka Cluster Architecture


Kafka architecture can also be described as a cluster with different components. 

Kafka Broker

A Kafka cluster often consists of many brokers. One Kafka broker can be used to handle thousands of reads and writes per second. However, since brokers are stateless they use Zookeeper to maintain the cluster state.

Kafka ZooKeeper

This uses ZooKeeper to manage and coordinate Kafka brokers in the cluster. The ZooKeeper notifies the producers and consumers when a new broker enters the Kafka cluster or if a broker fails in the cluster. On being informed about the failure of a broker, the producer and consumer decide how to act and start coordinating with other active brokers. 

Kafka Producers

This component in the Kafka cluster architecture pushes the data to brokers. It sends messages to the broker at a speed that the broker can handle. Therefore, it doesn’t wait for acknowledgments from the broker. It can also search for and send messages to new brokers exactly when they start.

Kafka Consumers

Since brokers are stateless, Kafka consumers maintain the number of messages that have been consumed already and this can be achieved using the partition offset. The consumer remembers each message offset which is an assurance that it has consumed all the messages before it. 



Kafka cluster setup via Docker

version: '2'

services:

  zookeeper:

    image: wurstmeister/zookeeper

    ports:

      - "2181:2181"

  kafka-1:

    image: wurstmeister/kafka

    ports:

      - "9095:9092"

    environment:

      KAFKA_ADVERTISED_HOST_NAME: kafka1

      KAFKA_ADVERTISED_PORT: 9095

      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181

      KAFKA_LOG_DIRS: /kafka/logs

      KAFKA_BROKER_ID: 500

      KAFKA_offsets_topic_replication_factor: 3

    volumes:

      - /var/run/docker.sock:/var/run/docker.sock

      - kafka_data/500:/kafka


  kafka-2:

    image: wurstmeister/kafka

    ports:

      - "9096:9092"

    environment:

      KAFKA_ADVERTISED_HOST_NAME: kafka2

      KAFKA_ADVERTISED_PORT: 9096

      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181

      KAFKA_LOG_DIRS: /kafka/logs

      KAFKA_BROKER_ID: 501

      KAFKA_offsets_topic_replication_factor: 3

    volumes:

      - /var/run/docker.sock:/var/run/docker.sock

      - kafka_data/501:/kafka


  kafka-3:

    image: wurstmeister/kafka

    ports:

      - "9097:9092"

    environment:

      KAFKA_ADVERTISED_HOST_NAME: kafka3

      KAFKA_ADVERTISED_PORT: 9097

      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181

      KAFKA_LOG_DIRS: /kafka/logs

      KAFKA_BROKER_ID: 502

      KAFKA_offsets_topic_replication_factor: 3

    volumes:

      - /var/run/docker.sock:/var/run/docker.sock

      - kafka_data/502:/kafka

Start The Cluster

Simply start the cluster using the docker-compose command from the current directory:
$ docker-compose up -d

We can quickly check which nodes are part of the cluster by running a command against zookeeper:
$ docker-compose exec zookeeper ./bin/zkCli.sh ls /brokers/ids

And that’s it. We’ve now configured a kafka cluster up and running. We can also test failover cases or other settings by simply bringing one kafka node down and seeing how the clients react.

Self-managed Kafka Services

We can also use Cloud-based self-managed kafka service on different cloud service providers. On aws,  They have Fully managed, highly available, and secure Apache Kafka service like Amazon MSK (Amazon Managed Streaming for Apache Kafka)

Thursday, December 7, 2017

How To Use Alexa On Amazon Fire TV

How To Use Alexa On Amazon Fire TV
Alexa is a personal assistant developed by Amazon Inc. exclusively for the Amazon powered devices. Initially, it was designed to be used in hardware versions such as Amazon Echo and Amazon Echo Dot. However, Amazon later rendered support for the Fire TV as well. Alexa lets you perform a number of tasks through voice interaction. Alexa is also capable of music playback, setting alarms, streaming podcasts, playing audiobooks and providing real-time weather information.

There are two ways you can use Alexa to control your Amazon Fire TV device. First off, if you have a Fire TV remote with a Voice button, you can use it to perform specific functions on your Fire TV by interacting with Alexa. You can also perform the same action on your Fire TV remote app. Else, if you have an Alexa enabled device such as Amazon Echo or Amazon Echo Dot, you can also use it to control specific features of your Amazon Fire TV device without using a remote.


Using Alexa Through Voice Remote
If you have a Voice button on your Fire TV remote, just press and hold the Voice button and say whatever you want Alexa to do for you. You can search for movies, TV shows, play music, launch apps and much more. However, if you don’t have a Voice button on your Fire TV remote, you can still perform the same action using the Fire TV remote app on your smartphone.


Wednesday, December 6, 2017

Amazon Rolls Out AI Tools And Camera For Businesses

Amazon Rolls Out AI Tools And Camera For Businesses
Amazon web services, the biggest provider of Cloud computing services, has launched a series of AI business tools including AI-powered Camera. As far as AI technologies are concerned, Amazon has been a lot active in engaging with AI services. Amazon wants to help companies in implementing AI systems in a lot easier way.


Amazon web services announced about AI tools at annual re:Invent conference and also introduced $250 DeepLens Camera, which grabs much attention. DeepLens is a AI based camera for the developers which can be used to develop their own machine learning apps and hardware. This DeepLens camera is designed for developers only, not consumers.

DeepLens is powered by an Intel Atom chipset, uses a four megapixel camera to take 1080P HD videos. A set of AI tools installed in the camera can recognize optical characters, and image and objects. The trained AI models in DeepLens are also able to detect cats and dogs, faces, a wide array of household and everyday objects, and many actions and motions. It has network and device connectivity by Wi-Fi, USB, and micro HDMI ports. It will let developers experiment and  develop apps along with hands-on experience with AI, IoT, and serverless computing. AWS DeepLens integrated leading-edge hardware and sophisticated on-board software, and allow you to utilize AWS Greengrass, AWS Lambda, and other AWS AI and infrastructure services inside your applications.


DeepLens combines  all varieties of Intel’s hardware and software expertise to provide the developers with a strong tool that can give limitless potential in Smart home AI integration. Let’s take an example, if you own a warehouse and need to scan the inventory automatically then you may require some DeepLens cameras to complete the task.


The new tools and products from the company shows that it is going to make an impact in every-day life with even more AI integrated products. Amazon has also  announced new AI-powered transcription and translation tools for deploying machine learning and a new AI service ,which is designed  for developers and businesses. Not only that, the company is soon to launch a new platform named SageMaker which is a end to end Machine Learning service. SageMaker platform is compatible with many popular frameworks such as Google’s TensorFlow, Facebook’s Caffe2, Pytorch, and MXNET.

Tuesday, September 19, 2017

You Can Talk to Alexa Over Slack Using Silent Echo

Silent Echo
Do you often feel like you don't want to talk to anyone, not even your Alexa? Though your handy virtual assistant Alexa is voice-activated now it gives you the option for chat. Amazon's Alexa voice assistant is one of the best digital assistants. But talking to Alexa all the time can be annoying sometimes. A Bot called ‘Silent Echo’ has been created by Bespoken. Bespoken is a company that offers tools for developing voice apps. It has released many open source commands line tools which have been adopted by nearly 700 voice app developers. It lets users interact with Alexa over Slack. The whole concept is that there are times when you want to chat with Alexa but you don't wish to yell out to it, then the chat option comes to the rescue. 

The Silent Echo boot has the text-to-speech property. It uses Amazon’s API to convert the text to audio which is then sent to Alexa and returns the audio output from Alexa as a text. It will even convert your text to audio if there is a lot of voice in the background. The new feature can be really useful in number of situations like Sometimes your room might be too noisy, in that case, your Alexa won't be able to hear you properly. Silent Echo is able to control home devices. But this new feature has a little disadvantage as it does not allow you to do all the things that Alexa do. That includes, unable to control music devices which mean you won't be able to control Spotify or any other music services, it will also unable to use Alexa skills. 


Due to the Security reasons, Silent Echo doesn't even allow you to do anything related to payment account which means you won't be able to order anything. Instead, you will be able to do all the daily chores like turn on or off lights, ask weather updates and things like that. It can also be used in group chats.  After installing silent Echo on slack, you can message Silent Echo bit or even call it up in a group chat by writing @silentecho.