I'm pretty new to NoSQL in general but I'm trying azure's cosmos db to store my logs. I've been really struggling with their UI.
In the image below, I just created a random collection and added a simple entity with 3 fields. All I want to do at this point is so reduce the columns so that I only see the ones I want. Granted I can't remove the first 3 columns, whenever I try to remove any column at all, I get this error and instead of removing the columns it just leave it blank. Now I can't find any documentation for this simple UI (which shouldn't really be the case) so here are some things maybe someone can help me out.
How to remove columns. Like in SQL, only display the columns I want?
How to create custom query? The query builder here is really limited and unusable to be honest.
Is there any other DB Client similar to MongoDB's compass that might make the UI easier?
1.How to remove columns. Like in SQL, only display the columns I want?
You could choose your desired columns in the advanced options,but the PartitionKey,RowKey and TimesStamp are default columns in cosmos db table api,you can't remove them in the portal data explorer.
2.How to create custom query?
Same as above situations,it has limitation in the portal UI.
3.Is there any other DB Client similar to MongoDB's compass that might make the UI easier?
However,you could download the Azure Storage Explorer so that you could easily manage the contents of your storage account.
It's more flexible than portal UI ,such as you could filter the columns,including the default columns.
However, the general design of the tool UI is similar to the portal UI.
BTW,as #David mentioned in the comment,if you want to query the data more flexible with sql language,you need to consider using Cosmos DB SQL API instead of Cosmos DB Table API.
I agree that the experience could be quite daunting. As a suggestion, you could try Cerebrata (https://cerebrata.com/) as a cost-effective solution.
The tool basically allows you to remove the desired columns in just a few clicks (as projected in the GIF below). The tool also allows you to edit multiple entities in bulk and more.
CosmosDB Delete entities Table API - Cerebrata
Related
I have events in firebase database table where each event has certain fields. One of the field is event_type. What I want to achieve is to be able to visualize in graphical form, how many events of each type comes daily?
How do I do something like that in firebase database?
Q1. Is it possible to directly do this in firebase?
Q2. Do I need to move data to some other datasource (like Big query) and setup dashboard there?
It is definitely possible to create a dashboard with aggregate data directly on the Firebase Realtime Database. But you'll have to take a different approach than with e.g. BigQuery.
With relational databases, you'll create a dashboard by running aggregation queries. For example to show how many events of each type, you'll run something like SELECT type, COUNT(*) FROM events GROUP BY type.
The Firebase Realtime Database (and most NoSQL databases) don't have such a GROUP BY operation, not a COUNT() method. So that means that you'd have to load all data into your dashboard, and group/count it there, which is quite expensive. That why on NoSQL databases you'll typically keep a running count for each type in the database and update that on every write operation. While this puts an overhead on each write operation, the dashboard itself suddenly becomes very simply when you do this. For an example of a simple counter, see the function-samples repo.
This approach only works if you know up front what counters (and other aggregates) you want to show in the dashboard. If that isn't the case, many developers use the nightly backups from the Realtime Database to ingest the data into another system that lends itself more to exploratory querying, such as BigQuery.
Either approach can work fine. The right approach is a matter of your exact use-case (e.g. do you know the exact data you want in the dashboard, or are you still figuring that out?) and what you're most comfortable with.
I'm trying to flatten the data in my firebase app. The database design has a list of users and a list of projects. The users will own the projects and need to have a list of indexes into which projects they own. The users list is indexed by uid which is unique. With the projects I am using a list of projects with a unique ids. The projects are managed using firebaseArray and created with the $add. I'm trying to use the flattened data model illustrated in the guide in the structuring data section. The problem is that the unique ids generated by the $add have special characters in them and can't be used as the index for the project in the users object. An error is generated when trying to create an object where one of the members has 'special characters' in it.
What is the recommended way to work around this?
For my app I used the orderBy and equalTo with the userId in the projects. This seems to work very well. OrderBy seems like an odd term to use. Its more like a select.
I'm coding a little model layer on top of angularfire, it basically handles (most of ) the pain coming with denormalized data model, you may want to take a look at it angularfire-resource
PS : I'm still working on it so it's a bit early to use it in production, but i start to be pretty happy about it and it may give you some ideas
I'm watching an sqlite db which an app uses.
I want to know what changes have been made since
I last checked.
I can dump to sql and diff against the last dump,
but it seems there should be a better way.
Is there?
Thanks,
Kent
PS Not to be coy, specifics: I'm managing photos with Shotwell, which has a great GUI.
I'm mirroring Shotwell's db in Postgresql, where I've restructured and augmented to my liking. After a Shotwell session, which involves adding, tagging, adjusting ... I want
to apply those changes to Postgres.
Add a field named _changed to your table(s). On every manipulation (update, insert into...) of a row set the field to the current timestamp. Now you can check which rows have been updated since.
I have worked on a timesheet application application in MVC 2 for internal use in our company. Now other small companies have showed interest in the application. I hadn't considered this use of the application, but it got me interested in what it might imply.
I believe I could make it work for several clients by modifying the database (Sql Server accessed by Entity Framework model). But I have read some people advocating multiple databases (one for each client).
Intuitively, this feels like a good idea, since I wouldn't risk having the data of various clients mixed up in the same database (which shouldn't happen of course, but what if it did...). But how would a multiple database solution be implemented specifically?
I.e. with a single database I could just have a client register and all the data needed would be added by the application the same way it is now when there's just one client (my own company).
But with a multiple database solution, how would I create a new database programmatically when a user registers? Please note that I have done all database stuff using Linq to Sql, and I am not very familiar with regular SQL programming...
I would really appreciate a clear detailed explanation of how this could be done (as well as input on whether it is a good idea or if a single database would be better for some reason).
EDIT:
I have also seen discussions about the single database alternative, suggesting that you would then add ClientId to each table... But wouldn't that be hard to maintain in the code? I would have to add "where" conditions to a lot of linq queries I assume... And I assume having a ClientId on each table would mean that each table would have need to have a many to one relationship to the Client table? Wouldn't that be a very complex database structure?
As it is right now (without the Client table) I have the following tables (1 -> * designates one to many relationship):
Customer 1 -> * Project 1 -> * Task 1 -> * TimeSegment 1 -> * Employee
Also, Customer has a one to many relationship directly with TimeSegment, for convenience to simplify some queries.
This has worked very well so far. Wouldn't it be possible to simply have a Client table (or UserCompany or whatever one might call it) with a one to many relationship with Customer table? Wouldn't the data integrity be sufficient for the other tables since the rest is handled by the relationships?
as far as whether or not to use a single database or multiple databases, it really all depends on the use cases. more databases means more management needs, potentially more diskspace needs, etc. there are alot more things to consider here than just how to create the database, such as how will you automate the backup process creation, etc. i personally would use one database with a good authentication system that would filter the data to the appropriate client.
as to creating a database, check out this blog post. it describes how to use SMO (sql management objects) in c#.net to create a database. they are a really neat tool, and you'll definitely want to familiarize yourself with them.
to deal with the follow up question, yes, a single, top level relationship between clients and customers should be enough to limit the new customers to their appropriate data.
without any real knowledge about your application i can't say how complex adding that table will be, but assuming your data layer is up to snuff, i would assume you'd really only need to limit the customers class by the current client, and then get all the rest of your data based on the customers that are available.
did that make any sense?
See my answer here, it applies to your case as well: c# database architecture
I need to store a few attributes of an authenticated user (I am using Membership API) and I need to make a choice between using Profiles or adding a new table with UserId as the PK. It appears that using Profiles is quick and needs less work upfront. However, I see the following downsides:
The profile values are squished into a single ntext column. At some point in the future, I will have SQL scripts that may update user's attributes. Querying a ntext column and trying to update a value sounds a little buggy to me.
If I choose to add a new user specific property and would like to assign a default for all the existing users, would it be possible?
My first impression has been that using profiles may cause maintainance headaches in the long run. Thoughts?
There was an article on MSDN (now on ASP.NET http://www.asp.net/downloads/sandbox/table-profile-provider-samples) that discusses how to make a Profile Table Provider. The idea is to store the Profile data in a table versus a row, making it easier to query with just SQL.
More onto that point, SQL Server 2005/2008 provides support for getting data via services and CLR code. You could conceivably access the Profile data via the API instead of the underlying tables directly.
As to point #2, you can set defaults to properties, and while this will not update other profiles immediately, the profile would be updated when next it is accessed.
Seems to me you have answered your own question. If your point 1 is likely to happen, then a SQL table is the only sensible option.
Check out this question...
ASP.NET built in user profile vs. old stile user class/tables
The first hint that the built-in profiles are badly designed is their use of delimited data in a relational database. There are a few cases that delimited data in a RDBMS makes sense, but this is definitely not one of them.
Unless you have a specific reason to use ASP.Net Profiles, I'd suggest you go with the separate tables instead.