Firebase Event Logging offline and online in Android [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
If I log events offline and then send them online in a bulk to Firebase then, will the event date be the same as the date of sending or logging?

Neither Cloud Firestore nor Firebase Realtime Database does not have the date and time stored in the metadata. If you need this feature, you should add a timestamp property for each document/node separately. That actually represents a FieldValue.serverTimestamp() in case of Cloud Firestore and a ServerValue.TIMESTAMP in case of Firebase Realtime Database.
Please also bear in mind that both types of timestamps are generated on the server. In the case of Cloud Firestore it's a Date object, and in case of Firebase Realtime Database is a long value which represents the time since the Unix epoch, in milliseconds.
If you have this kind of property present in your database and you set/modify it once an object is added/changed, then the date and time of that property is the date and time when the device comes back online since the timestamp is generated entirely by Firebase servers. And to answer your question:
will the event date be the same as the date of sending or logging?
It will be the time of sending and not logging.

Related

Retrieving new oracle table records on insert to process in Java client application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 13 days ago.
Improve this question
I am trying to retrieve the new inserts from a table in my java client application (Spring JMS), to do some processing and send them to a message broker. I do not have access to any CDC tool like Goldengate. I only need the new inserts and not the updates or deletes. I am having difficulty finding a way to do this. Is there a way to do this? I read that there is an option to do these with triggers, but will it have a high throughput on the db, because this table gets a lot of inserts in a day (approximately around 50K records inserted in a day).
Thanks in advance
50,000 rows per day is actually rather a low volume. Some data warehouse tables get 50 million rows a day. So an insert trigger is unlikely to make any appreciable difference on the loading job. Add a date column (e.g. LOAD_DATE) and have a before insert trigger assign :new.LOAD_DATE := SYSDATE.
That being said, if you wanted to avoid a trigger, you can modify the loading job itself to load such a date a column with SYSDATE.
With either method, your retrieval is then simple: each day as you retrieve records, record the maximum LOAD_DATE value you retrieved. The next day, pull only records with a LOAD_DATE >= that value.

Sending an email at a specific time using spring boot [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 months ago.
Improve this question
in the application I am developing I can specify an expiration date of a license and now I want to create an a java spring boot api that can send an email to a specific email before a specific time period (the user can choose the time period). The purpose of the email is to notify the user that his license is about to end.
For example:
The user chooses an expiration date of 3/8/2023 and chooses to be notified 3 months before the expiration date chosen. An email gets sent to the user's email on 3/5/2023 notifying the user that the license is about to end.
Any help is highly appreciated.
You need to store the info in database. So that your system knows when to send the email. For ex, having two columns in a table like send_notif_date, send_to_user.
write a job(you can use Quartz for this) which will pick all details of user for which we need to send the emails based on if today equalsTo send_notif_date

Firebase together with sqlite [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have an app (field data collection) where I used the sign in option and authentication with firebase.
All the other database the default option is to store data as a local SQLite database, however, I want to add the option if the user wants to sign in and transfer the local database to an online database so it can be accessed on multiple devices.
Can I have together firebase and sqlite?
I mean can the user store the data offline and when goes online with a sync button can have the data online in the firebase cloud?
My sqlite database stores data from drop down columns, google maps longtitude and latitude data, voice recordings and images.
I would appreciate your help, and hope you understand my questions!
Yours sincerely,
Tzirineto
Yes, this can be possible. The data in SQLite is stored in the form of tables i.e rows and columns i.e. its a relational database. But the data in the firebase id store in the form of documents i.e. key-value pair. Your first step is to create objects in Java. Then it will be easy for you to dump same objects in both SQLite and in firebase. Also you have to maintain a proper relations among the data using uid in firebase. When the user clicks sync button you have to add the objects in the firebase. In order to do that first you have to retrieve the complete data from SQLite and store it into java objects then send them to firebase. You have to keep a check among relationship that exists among the data. Hope it helps

Handling multiple timezone in Java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I need to store multiple user details from different country. How can I store the dates in DB (in UTC format) and how can I show the dates to the users accorning to their time zones.
I am using Java and mySQL.
In MySQL, use the TIMESTAMP data type in your tables.
For each user, store a timezone column, VARCHAR(64) is a good data type for that column. When a user registers to use your system, ask for the time zone value. Mine is America/New_York. Yours might or might not be Asia/Kolkata. For a user interface for this user-preference setting, the WordPress.org software has a good example.
Finally, whenever you establish a connection from your Java program to your DBMS in behalf of a user, issue the SQL command
SET SESSION time_zone='(whatever tz string the user gave you)'
before you handle any user data.
This will cause all times going in to your tables to be converted to UTC, and all times coming out to be translated to local. It works properly for NOW() and CURDATE(). Again, you must use TIMESTAMP and not DATETIME or DATE data types for this.
Make sure your server OS and default MySQL time zones are set to UTC. If you don't do this before you start loading information into your database, it will be almost impossible to fix. If you use a vendor to run MySQL, insist they get this right and fire the vendor if they don't have it right.

How would you design a twitter like message system, how to design the messaging system? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
If you were to create an application like twitter, how would you go about designing the messaging system?
Specifically look for ideas on the basic data model, and how you would write the method that takes the user's tweet and then sends it out to all its followers?
example:
Tweets ( tweetID, userID, message, datesend)
User (userID, ...)
Followers(userID, followerUserID)
Inbox(userID, tweetID)
is the above model a good starting point?
Would you first insert the tweet, then push a message to the queue. Then one-by-one, take a message off the queue and push the message to its subscribers?
(I am ignoring the mobile functionality of twitter, just focussing on the web based functionality, but I thought of using a queue from the start so one could add other functionality later)
The High Scalability blog has a number of articles on twitter and it's infrastructure and changes over time that might interest you.
I don't think twitter uses a message queue (inbox in your data model.) I think in twitter everything is done via date. Thus each user has a "last viewed date" and the inbox/message queue is created by looking for all subscribed tweets after that last viewed date.
So to modify your data model, remove inbox and add in a last view date column to user.
Also I would expect that follower information is not stored as who follows a user but instead as which users a give user is following. Of course it could be stored both ways but that seems to make more sense to me.

Categories

Resources