New to AWS, I am writing a code for IDE in java so its desktop based application. I am trying to log some events in the application and I want it to be logged on cloud server. So, basically trying different services of aws. Tried for cloud watch, but it works on only aws applications. Trying to get more data on xray and IOT analytics. But no success. Can anybody suggest a proper solution.
Or is there a way that I can log the events somewhere on server and read through cloud watch.
Cloudwatch logs is the AWS native logging service. There are several ways to send data to it.
You can install an agent on your cloud/on-prem server and send logs to it.
Using the AWS API to send logs directly (you should probably use the SDK)
For either of those options, you will need to ensure you enable your application to access AWS. This is usually done by creating a user and role, and generating an access and secret key. There's a lot of nuance to doing this part correctly, so take your time.
The other tools you mentioned provide different services. XRAY is an Application Performance Monitoring tool that will let you get trace data and other insights into how your application runs. You usually correlate log data to this to help with debugging. IOT Analytics is specific to Internet Of Things / embedded devices and probably not a good fit for your Java app.
Related
I am creating an app using React-Native for the front-end, Java for the back-end and PostgreSQL for the database.
One feature of this app is to allow users to add each other as friends and instant message them - just like other social networks. At the moment, security is not a priority but I don't want to create something that I will have to completely redo when I do have to make it secure!
The goal here is to give each user the ability to send/receive messages to/from their friends. They also need to be able to view the message history with each contact.
I just need some advice on the following points to get me going as I haven't gotten very far on my own:
How should I send messages from the front-end, to the Java server and then to the receiver? This will involve the app having to listen for new messages so would the Socket.IO library be the way to go for this?
How I should store the messages in the database? E.g. have a table for messages with user_ids to be used for retrieval?
I should point out that I am very new to React-Native, databases and networking so I am finding this very challenging!
I will massively appreciate any help and any examples would be fantastic!
You should use WebSocket on the server. Spring supports it
Here's a tutorial I wrote about sending messages from PostgreSQL to the browser using WebSocket, which isn't exactly what you're going to do, but can hopefully get you started:
http://blog.databasepatterns.com/2014/04/postgresql-nofify-websocket-spring-mvc.html
We have multiple java web applications and processes that are deployed on a server. we would like to find a mean to easily monitor these applications and check their status remotely. by motoring we mean the following :
Check if the websites are up, send notifications by email otherwise.
Easily access or display logs in real-time that are located in different places on our servers. Send emails when exceptions occurred and are logged
Issue commands and run scripts that are located on our servers. the os of the server is linux. commands could be like restart tomcat...
? not sure if there are other ideas about monitoring
My question is that is there any application that is already available that provide such functionalities or some of them? if not do you know what API can be used to build such applications (in JAVA).
UPDATE:
The tool should be free
Thanks in advance for any help!
For monitoring Java applications as well as website availability, issuing custom commands in your servers and in general, monitor applications go for a general-purpose monitoring solution, like Pandora FMS. I'll try to answer your questions in order:
Check if the websites are up, send notifications by email otherwise.
Doing a network check to TCP port 80 and parsing a 200 OK response.
Easily access or display logs in real-time that are located in different places on our servers. Send emails when exceptions occurred and are logged
Easy thing to do with the log retrieval feature. Check it out in the wiki.
Issue commands and run scripts that are located on our servers. the os of the server is linux. commands could be like restart tomcat...
I'd suggest using Pandora Agents in this case. Quite powerful, yet very low resource consumption. They allow to do post-actions if your app is down, your CPU is high, or in general terms, anything you can measure happens. Check out the server monitoring more deeply: http://pandorafms.com/monitoring-solutions/server-monitoring/
On Linux, you an use monit. You can use it to any monitor services such as apache as well as wildfly running behind apache. It is actually easy to configure and it also gives all that you have requested.
If you want to monitor java processes, there is nothing better than MoSKito: http://www.moskito.org.
The only problem is that it covers much more, than you stated as your requirements, you will also get:
health thresholds and notifications
detailed performance metrics of your java code
dashboards with most important information about your app
mobile applications to monitor your app on the run
detection of slow transactions in your application
and more more more ;-)
http://www.moskito.org
http://newest.moskito.org/moskito/ (nightly build of the UI)
Step by Step guide: http://blog.anotheria.net/msk/the-complete-moskito-integration-guide-step-1/
I am interested in using DynamoDB through Heroku. Will this work securely and how would I set up communication? I am using Java but help in any language would be fine.
Sources of info I've found thus far:
This question seems to imply it is possible without explaining how.
This question explains how Heroku can connect to elasticache (not DynamoDB) but goes on to explain that it is insecure as any Heroku application can connect to the elasticache server. I would like to make sure that however I connect to DynamoDB is, in fact, secure.
This video explaining how to connect to DynamoDB via Ruby in Heroku is no longer available.
This video keeps talking about how they're going to use DynamoDB from Heroku, and then the next presenter admits that he couldn't get something else to work and never went on to talk about using DynamoDB in Heroku.
Yes. You can indeed use DynamoDB with Heroku. I use it for a large application that handles about 15 billion requests per month.
Here's what you'll want to do:
Set your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables in your Heroku app. When you sign up for AWS, you'll have to generate these if you have none already. Once you get them, store them in Heroku as environment variables.
Install a DynamoDB library in your language / framework of choice.
When you initialize your AWS library for DynamoDB, it will ask for 2 things: your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, so you can supply those from your environment variables.
The way this works in terms of security is like so:
Heroku runs on AWS in the us-east region.
If you create a DynamoDB instance in us-east, it will be in the same 'network' as your Heroku app.
When your Heroku app connects to DynamoDB, it will do so securely over SSL, using your AWS API keys as a username/password to connect.
When your Heroku app makes requests to DynamoDB, it will be very fast, as both your Heroku app and your DynamoDB instance are very close together physically.
Hope this helps =)
I am working on an android application which needs to fetch data from a cloud server . I know how to send a post request to a server and get data in return but i have never worked with cloud server before . https://developer.android.com/guide/topics/data/backup.html
i have visited this website but it's not that much of help to me i am confused as to how to send request to the server and retrieve data . I don't know anything about cloud servers .
A cloud server is just a normal server hosted in a some 'cloud providers' data centre. It is typically a virtual server - i.e. a single physical server running multiple virtual servers.
From your point of view you can think of it as just a regular server.
What may be causing confusion is that there are also 'Mobile Backed as a Service' providers - these allow you interact with servers, typically ones hosted in a cloud, but may allow you interact with them using a mobile SDK (or library) rather than using traditional client server communication. Your app usually needs to know nothing about the individual servers and you yourself don't need to create or manage any servers either.
Take a look here for a good overview of this latter approach:
https://parse.com/docs/android/guide
I have a very basic design of my entire application, where several users with my app on there android devices commits data to the server (I have used REST web services(java) + postgresql as my server) through HTTP post request from the android application. I am successful in achieving this and app runs absolutely fine. Now i want to implement a scenario where any change(CRUD operations) on my db on server should create a notification on my users android device. How should i achieve this with my server design unchanged? I have looked into Google Cloud Messaging, but could figure out the server implementation.
For now i have implemented db triggers on postgresql and able to get control back into java code using Notify/Listen feature of postgresql. From here i need to connect to android device. How can this be achieved. Is Google Cloud Messaging the only way? I have not seen any insert/update statements in there server implementation. Could anyone please guide me on this?
either you can use GCM or implement a Socket at server end and open a socket connection from mobile but this approach may add some additional processing overhead because it will create a daemon thread to listen socket port from mobile device.
You should use native library (NotificationManager etc.), here you can find a great tutorial.
My Advice is for you to use GCM. GCM normally takes a maximum of 4kb, so you could have your own defined "commands". You could use them to determine the requests on both ends, ie on android app and the server end. A php script on the server would help you in this.
I am working on an app where by the android app sends messages to the server via POST and the server forwards the message to the appropriate user via GCM. In my case I have very many things to share so in that case I am using commands, for example if it is a new incoming message I send a GCM to the app with one variable as the command and the rest as the data. On the android app I use the command variable to determine what to do with the data.
Kindly avoid that socket advice, it will have your app drain the battery to sustain the open socket , besides you don't have to re-invent the wheel while Google servers already has it