couch db finding data without views - database

I want to know is there any way in Couch DB HTTP API to query database without VIEWS ? We can GET all documents / document with specific id but what if we want to query database with key other then ID, without using VIEWS ?

You cannot query a CouchDB database by anything other than primary key (ID) without using views. In CouchDB world, views are queries.

You can get the data from CouchDB without views using HTTP API of couchDB.
http://wiki.apache.org/couchdb/HTTP_Document_API
Documents stored in a CouchDB have a DocID. DocIDs are case-sensitive string identifiers that uniquely identify a document. Two documents cannot have the same identifier in the same database, they are considered the same document.
http://localhost:5984/test/some_doc_id
http://localhost:5984/test/another_doc_id
http://localhost:5984/test/BA1F48C5418E4E68E5183D5BD1F06476

Related

Entities with relationships transfering via serialization problem - different IDs Entity Framework Core , SQL

I am using EF core and SQL database in my project. I have data model with several entities (principal with child/dependent ones) and as key I used int IDs. My entities have also defined unique UUID property for other usage. One of the is to identify same entity in test/production environment because primary key is not consistent. That means entity on test server ID=1 is not the same entity on other SQL server with production environment.
I thought using INT ID would be a good performance choice BUT I came to a problem:
I am in need to transfer selected data (entities) from test to production SQL server. My idea was to serialize those entities to JSON via .NET core native serializer from test machine and loading them to production one.
I am able to identify individual entities between enviroments via UUID property, but the problem is with setting relations/navigation between them. Have anyone solved similar issues?

Azure Search DataSource with on-premise SQL Server and best practices?

Documentation on Azure Search says I can use Azure Sql server as a datasource(https://azure.microsoft.com/en-us/documentation/articles/search-howto-connecting-azure-sql-database-to-azure-search-using-indexers-2015-02-28/). Can I do the same with an on-premise SQL server?
I have a typical relational structure like
User Table -> Address Table
User Table -> UserDetails table etc..
All linked to each other via foreign keys. My search should end up with an UserId, so I can link to my UserDetailsPage.aspx?UserId=xxx
What will be the best suggested way to build the datasource? Should I Create a view and apply change tracking on it? or Should I create a different datasource for each table and sync the concerned index?
Please shed some light on best practices in a typical relational database scenario.
you would need to allow the IP address of your search service to connect to your on-prem DB.
In terms of view vs. multiple indexers targeting the same index - both approaches might work. What info will your users be searching on - address, details, or both? If it's only one of those, then you wouldn't have to index both tables.
Keep in mind that if you decide to index a view joining both tables, you won't be able to use SQL integrated change tracking, and will have to rely on a rowversion or timestamp column in the view.
HTH

load data to elastic search from sql server

I'm new to elastic search and I have a basic question.
I want to load data from database and search them by using elastic search in MVC.NET project, but cause of data I have in my database's table I cant't convert all of them to the json and search in thme by using elastic search. How should I fill data of the elastic search from the database in an mvc.net project. I don't want the whole solution because it is impossible just a general and brief explanation. thank you very much.
First of all you should be able to model your data from SQL to ElasticSearch.
As ElasticSearch is a NoSQL and document oriented database/search engine.
You need an indexer to index SQL data to ElasticSearch.
Get all the columns associated with one record that you want to search in ElasticSearch from your SQL database (use joins if data is in multiple tables).
Use a dedicated Stored Procedure to get only needed data and construct a document class, serialize to JSON and index in your ElasticSearch cluster.
Use ElasticSearch.net client as they very neatly expose bulk index APIs.
Hope this will get you started. Have fun

Is there a GUID per MySQL database?

I am looking for a way to get a unique ID per database itself. The idea is to exchange objects between different installations of my application. Therefore I have unique IDs for all objects within a single database, but in order to exchange these objects to other databases with the same schema, I introduced a composite ID consisting of a primary and a secondary ID, where the primary is unique within a single database and the secondary should be unique across multiple databases with the same schema.
Does somebody knows a decentralized solution for this issue?
Using a global unique identifier for each row solves the problem. Java itself provides a UUID generator, but there are more (better) third-party generators as well.

Add user-defined module into Database Engine to pre-processing T-SQL queries

I write a module to translate 1 sql query into another query. When users send sql queries to DB-Engine, then DB-Engine will firstly forward these queries to my defined-module before processing sql syntax.
How can I integrate my-defined module to DB-Engine of SQL Server?
You can redirect queries for certain data to different tables using a partitioned view:
http://technet.microsoft.com/en-US/library/ms188299(v=SQL.105).aspx
In a nutshell, you tell the server some rules as to which values reside in which tables (usually based on primary or foreign key ranges for example). When you query using the partition field, the database can direct your query to the correct remote table. But you can still do queries over all the tables just as if they were held locally (except more slowly).

Resources